Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Funfare's avatar
Level 13

npm run dev not working

Hi,

i have a fresh install of homestead with vagrant and virtual box on win 10 and laravel 5.4.

I want to try Vue, but I'm failing to use npm. I get these errors:

npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm run dev

> @ dev /home/vagrant/Code
> npm run development


> @ development /home/vagrant/Code
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.c              onfig.js

 95% emitting

 ERROR  Failed to compile with 43 errors                                                                                                            3:55:50 PM

These dependencies were not found:

* child_process in ./node_modules/cross-spawn/index.js, ./node_modules/execa/index.js and 1 other
* fs in ./node_modules/babel-core/lib/api/node.js, ./node_modules/babel-core/lib/transformation/file/options/build-config-chain.js and 36 others

To install them, you can run: npm install --save child_process fs


These relative modules were not found:

* ../../package in ./node_modules/babel-core/lib/api/node.js
* ./lib-cov/concatenate in ./node_modules/concatenate/index.js                                                                                                Asset      Size  Chunks                    Chunk Names
     /js/vendor.js   4.31 MB       0  [emitted]  [big]  /js/vendor
        /js/app.js    274 kB       1  [emitted]  [big]  /js/app
   /js/manifest.js   5.82 kB       2  [emitted]         /js/manifest
public/css/app.css  75 bytes       1  [emitted]         /js/app

npm ERR! Linux 4.4.0-81-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "development"
npm ERR! node v6.11.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/Code/npm-debug.log

npm ERR! Linux 4.4.0-81-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
npm ERR! node v6.11.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script 'npm run development'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/Code/npm-debug.log

npm-debug.log:



0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'dev' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle @~predev: @
6 silly lifecycle @~predev: no script for predev, continuing
7 info lifecycle @~dev: @
8 verbose lifecycle @~dev: unsafe-perm in lifecycle true
9 verbose lifecycle @~dev: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/vagrant/Code/node_modules/.bin:/home/vagrant/.composer/vendor/bin:/home/vagrant/bin:/home/vagrant/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
10 verbose lifecycle @~dev: CWD: /home/vagrant/Code
11 silly lifecycle @~dev: Args: [ '-c', 'npm run development' ]
12 silly lifecycle @~dev: Returned: code: 1  signal: null
13 info lifecycle @~dev: Failed to exec dev script
14 verbose stack Error: @ dev: `npm run development`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:891:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid @
16 verbose cwd /home/vagrant/Code
17 error Linux 4.4.0-81-generic
18 error argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
19 error node v6.11.1
20 error npm  v3.10.10
21 error code ELIFECYCLE
22 error @ dev: `npm run development`
22 error Exit status 1
23 error Failed at the @ dev script 'npm run development'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the  package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     npm run development
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

Edit: NodeVersion : 6.11.1 npm version 3.10.10

I tried removing node_modules and install it again, tried --no-bin-links, npm run watch but i get the same error...

Does anybody knows how to fix that?

Thanks!

Greetings, Nico

0 likes
2 replies
topvillas's avatar
npm ERR! Make sure you have the latest version of node.js and npm installed
Funfare's avatar
Level 13

I updated from LTS version to the latest version.

Now I get an error when I use npm install: (running vagrant up as administrator, same error when --no-bin-links)

 npm install
npm ERR! path /home/vagrant/Code/node_modules/fsevents/build/Release/.deps/Users/eshanker/Code/fsevents/lib/binding
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rmdir
npm ERR! ETXTBSY: text file is busy, rmdir '/home/vagrant/Code/node_modules/fsevents/build/Release/.deps/Users/eshanker/Code/fsevents/lib/binding'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2017-08-17T21_49_14_703Z-debug.log

after the install process there ist no node_modules/fsevents folder.

2202 info lifecycle [email protected]~postinstall: [email protected]
2203 silly postinstall [email protected]
2204 info lifecycle [email protected]~postinstall: [email protected]
2205 verbose unlock done using /home/vagrant/.npm/_locks/staging-dca959ab9303d45c.lock for /home/vagrant/Code/node_modules/.staging
2206 verbose stack Error: ETXTBSY: text file is busy, rmdir '/home/vagrant/Code/node_modules/fsevents/build/Release/.deps/Users/eshanker/Code/fsevents/lib/binding'
2207 verbose cwd /home/vagrant/Code
2208 verbose Linux 4.4.0-81-generic
2209 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
2210 verbose node v8.4.0
2211 verbose npm  v5.3.0
2212 error path /home/vagrant/Code/node_modules/fsevents/build/Release/.deps/Users/eshanker/Code/fsevents/lib/binding
2213 error code ETXTBSY
2214 error errno -26
2215 error syscall rmdir
2216 error ETXTBSY: text file is busy, rmdir '/home/vagrant/Code/node_modules/fsevents/build/Release/.deps/Users/eshanker/Code/fsevents/lib/binding'
2217 verbose exit [ -26, true ]

files would be compiled but there is also an error, related to fsevents. But i can't install fsevents... Thought npm is easier on a homestead box

npm run dev

> @ dev /home/vagrant/Code
> npm run development


> @ development /home/vagrant/Code
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

 95% emitting

 ERROR  Failed to compile with 43 errors                                                  21:46:12

These dependencies were not found:

* child_process in ./node_modules/cross-spawn/index.js, ./node_modules/execa/index.js and 1 other
* fs in ./node_modules/babel-core/lib/api/node.js, ./node_modules/babel-core/lib/transformation/file/options/build-config-chain.js and 36 others

To install them, you can run: npm install --save child_process fs


These relative modules were not found:

* ../../package in ./node_modules/babel-core/lib/api/node.js
* ./lib-cov/concatenate in ./node_modules/concatenate/index.js                                    Asset      Size  Chunks                    Chunk Names
     /js/vendor.js    4.3 MB       0  [emitted]  [big]  /js/vendor
        /js/app.js    274 kB       1  [emitted]  [big]  /js/app
   /js/manifest.js   5.82 kB       2  [emitted]         /js/manifest
public/css/app.css  75 bytes       1  [emitted]         /js/app
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2017-08-17T21_46_12_234Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2017-08-17T21_46_12_254Z-debug.log

cat /home/vagrant/.npm/_logs/2017-08-17T21_46_12_234Z-debug.log  0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   '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/local/lib/node_modules/npm/bin/node-gyp-bin:/home/vagrant/Code/node_modules/.bin:/usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/vagrant/Code/node_modules/.bin:/home/vagrant/.composer/vendor/bin:/home/vagrant/bin:/home/vagrant/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle @~development: CWD: /home/vagrant/Code
10 silly lifecycle @~development: Args: [ '-c',
10 silly lifecycle   'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
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=node_modules/laravel-mix/setup/webpack.config.js`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:289:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:927:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid @
15 verbose cwd /home/vagrant/Code
16 verbose Linux 4.4.0-81-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "development"
18 verbose node v8.4.0
19 verbose npm  v5.3.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=node_modules/laravel-mix/setup/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 ]
cat  /home/vagrant/.npm/_logs/2017-08-17T21_46_12_254Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'dev' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle @~predev: @
6 info lifecycle @~dev: @
7 verbose lifecycle @~dev: unsafe-perm in lifecycle true
8 verbose lifecycle @~dev: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/vagrant/Code/node_modules/.bin:/home/vagrant/.composer/vendor/bin:/home/vagrant/bin:/home/vagrant/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle @~dev: CWD: /home/vagrant/Code
10 silly lifecycle @~dev: Args: [ '-c', 'npm run development' ]
11 silly lifecycle @~dev: Returned: code: 2  signal: null
12 info lifecycle @~dev: Failed to exec dev script
13 verbose stack Error: @ dev: `npm run development`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:289:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:927:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid @
15 verbose cwd /home/vagrant/Code
16 verbose Linux 4.4.0-81-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
18 verbose node v8.4.0
19 verbose npm  v5.3.0
20 error code ELIFECYCLE
21 error errno 2
22 error @ dev: `npm run development`
22 error Exit status 2
23 error Failed at the @ dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

Thanks for help

Greetings, Nico

Please or to participate in this conversation.