martzer's avatar

Laravel/Jetstream : can't run npm run dev

Hello,

I can install laravel and create a new project without any problem, but when I try to install Jetstream, after the npm install command, the npm run dev comment fail and give me an error while trying to build something with css file (css/app css)

I've try a lot of things, such as re-use npm install, clear cache, using yarn, npx, nothing did work

Thanks a lot for your help

0 likes
12 replies
mcangueiro's avatar

You need to be a little more specific. What exactly does the error message says? Have you checked your app.css file to see if everything is correct there? Is this a fresh install of jetstream?

martzer's avatar

70% building 343/343 modules 0 activenpm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ development: cross-env NODE_ENV=development node_modules/webpack/bin/webpackjs --progress --config=node_modules/laravel-mix/setup/webpackconfigjs npm ERR! Exit status 1 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! /root/npm/_logs/2020-11-18T13_18_53_856Z-debuglog npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ dev: npm run development npm ERR! Exit status 1 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! /root/npm/_logs/2020-11-18T13_18_53_897Z-debuglog

This is what my terminal is saying after i try "npm run dev"

martzer's avatar

@import 'tailwindcss/base'; @import 'tailwindcss/components'; @import 'tailwindcss/utilities';

And here is my app,css file (sorry i cant put any dot since its my first day )

mcangueiro's avatar

Try removing the node_modules completely and reinstall from scratch:

npm install && npm run dev

Also, could you please check the error logging above this error like is stated in the message?

Sinnbeck's avatar

According to the error you are missing a few dots (.) in the path to the webpack file (webpack.config.js). Can you check the package.json file?

cross-env NODE_ENV=development node_modules/webpack/bin/webpackjs --progress --config=node_modules/laravel-mix/setup/webpack.config.js
martzer's avatar

I have to remove dot to post content on this channels because otherwise it say "You cant use link the first day", thats why it look like there is missing dots

martzer's avatar

I did remove the node_modules folder and tried reinstall with : npm install && npm run dev

I got the same error

My app name is martzer

Here is the log file :

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/root/nvm/versions/node/v14151/bin/node',
1 verbose cli   '/root/nvm/versions/node/v14151/bin/npm',
1 verbose cli   'run',
1 verbose cli   'dev'
1 verbose cli ]
2 info using npm@6148
3 info using node@v14151
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: /root/nvm/versions/node/v14151/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/martzer/node_modules/bin:/root/nvm/versions/node/v14151/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: /var/www/martzer
10 silly lifecycle @~dev: Args: [ '-c', 'npm run development' ]
11 silly lifecycle @~dev: Returned: code: 1  signal: null
12 info lifecycle @~dev: Failed to exec dev script
13 verbose stack Error: @ dev: `npm run development`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter<anonymous> (/root/nvm/versions/node/v14151/lib/node_modules/npm/node_modules/npm-lifecycle/indexjs:332:16)
13 verbose stack     at EventEmitteremit (eventsjs:315:20)
13 verbose stack     at ChildProcess<anonymous> (/root/nvm/versions/node/v14151/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawnjs:55:14)
13 verbose stack     at ChildProcessemit (eventsjs:315:20)
13 verbose stack     at maybeClose (internal/child_processjs:1048:16)
13 verbose stack     at ProcessChildProcess_handleonexit (internal/child_processjs:288:5)
14 verbose pkgid @
15 verbose cwd /var/www/martzer
16 verbose Linux 540-48-generic
17 verbose argv "/root/nvm/versions/node/v14151/bin/node" "/root/nvm/versions/node/v14151/bin/npm" "run" "dev"
18 verbose node v14151
19 verbose npm  v6148
20 error code ELIFECYCLE
21 error errno 1
22 error @ dev: `npm run development`
22 error Exit status 1
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 [ 1, true ]
mcangueiro's avatar

I'm out of ideas here. Maybe someone else has any hints or tips. Sorry.

laracoft's avatar

@martzer

npm run dev has never worked for me as my filesystem is a mounted off a samba share. I used yarn run dev instead, but today, yarn run dev also failed on me. I'm trying to figure it out. Let you know again if I make any progress.

laracoft's avatar

@martzer

Is your error extracted from the FIRST time you run npm run dev? My errors are different on subsequent runs and only the error on FIRST run was helpful. Remove the entire node_modules to recreate the first run.

I would suggest trying yarn first, just replace all npm with yarn, if you still encounter problems, perhaps I can help.

Hondaman900's avatar

@laracoft - thank you! Replacing "npm" with "yarn" worked for me. yarn install and yarn run dev worked fine.

oirrc_developer's avatar

npm ERR! missing script: dev someone help in this .. i dont know what error is this .. i was installing jetstream and at last i got this? anyone

Please or to participate in this conversation.