Y
Y
Yaroslav2019-06-25 21:21:27
Node.js
Yaroslav, 2019-06-25 21:21:27

Why does npm swear "This dependency was not found: vue-select" on an installed package?

Good afternoon! I am far from JS, but I need to put the application on node.js. At the `npm run dev` step, the following problem pops up:

# npm run dev

> @ dev /var/www/antweb
> npm run development


> @ development /var/www/antweb
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=webpack.config.js

Copying node_modules/bootstrap-vue/dist/bootstrap-vue.css to /var/www/antweb/public/css/bootstrap-vue.css
 95% emitting

 ERROR  Failed to compile with 3 errors                                                                                     6:05:50 PM

This dependency was not found:

* vue-select in ./resources/assets/js/pages/register.js, ./resources/assets/js/pages/crud.js and 1 other

To install it, you can run: npm install --save vue-select     
....

It would seem that everything is simple, but this command does not help:
# npm install --save vue-select
npm WARN The package vuejs-datepicker is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ [email protected]
updated 1 package and audited 18946 packages in 27.866s
found 75 vulnerabilities (31 low, 24 moderate, 20 high)
  run `npm audit fix` to fix them, or `npm audit` for details

It looks like it's installed. But if we do it again npm run devwe have the same problem.
There is a directory node_modules/vue-select/, there are files in it.
Just in case, I opened the JS file in which it is used, it is used like this:
import vSelect from "vue-select";
Still there is a strangeness, it can be somehow connected. In package.json, it is now spelled out like this strangely:
....
    "vue-chartkick": "^0.2.2",
    "vue-disable-autocomplete": "0.0.4",
    "vue-select": "github:sagalbot/vue-select",
    "vue-socket.io": "^2.1.1",
....

That is, everyone is registered with versions, and he is indicating on github without a version.
Here is the log from npm run dev:
log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'development' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predevelopment', 'development', 'postdevelopment' ]
5 info lifecycle @~predevelopment: @
6 info lifecycle @~development: @
7 verbose lifecycle @~development: unsafe-perm in lifecycle true
8 verbose lifecycle @~development: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/antweb/node_modules/.bin:/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/antweb/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle @~development: CWD: /var/www/antweb
10 silly lifecycle @~development: Args: [
10 silly lifecycle   '-c',
10 silly lifecycle   'cross-env NODE_ENV=development ' +
10 silly lifecycle     'node_modules/webpack/bin/webpack.js --progress ' +
10 silly lifecycle     '--hide-modules --config=webpack.config.js'
10 silly lifecycle ]
11 silly lifecycle @~development: Returned: code: 2  signal: null
12 info lifecycle @~development: Failed to exec development script
13 verbose stack Error: @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=webpack.config.js`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:200:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:200:13)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid @
15 verbose cwd /var/www/antweb
16 verbose Linux 4.9.0-6-amd64
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "development"
18 verbose node v12.4.0
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 2
22 error @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=webpack.config.js`
22 error Exit status 2
23 error Failed at the @ development script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]


Any idea why it's installed but npm run devcan't see it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
doniyor1996, 2020-03-13
@doniyor1996

try changing
./resources/assets/js/pages/register.js
to
./assets/js/pages/register.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question