NPM run dev 报错?
环境:
- win7 X64 + phpstudy
- PHP7.2.10 + apache
- Laravel是5.5.X
- Yarn 1.7.0
- Node.js 10.5.0
已经在社区里看了好多帖子,还是解决不了,求大神指点下~
参考 4.2. 样式美化
install执行成功了
yarn install --no-bin-links
往下执行的时候就提示错误
D:\phpStudy\PHPTutorial\WWW\Laravel>yarn add cross-env
yarn add v1.7.0
info No lockfile found.
[1/4] Resolving packages...
然后我执行npm run dev就报错,日志如下:
0 info it worked if it ends with ok
1 verbose cli [ 'D:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dev' ]
2 info using npm[[@](https://learnku.com/users/10240)](https://learnku.com/users/8278)6.1.0
3 info using node[[@](https://learnku.com/users/10240)](https://learnku.com/users/8278)v10.5.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle [[@](https://learnku.com/users/10240)](https://learnku.com/users/8278)~predev: [[@](https://learnku.com/users/10240)](https://learnku.com/users/8278)
6 info lifecycle [[@](https://learnku.com/users/10240)](https://learnku.com/users/8278)~dev: [[@](https://learnku.com/users/10240)](https://learnku.com/users/8278)
7 verbose lifecycle [[@](https://learnku.com/users/10240)](https://learnku.com/users/8278)~dev: unsafe-perm in lifecycle true
8 verbose lifecycle [[@](https://learnku.com/users/10240)](https://learnku.com/users/8278)~dev: PATH: D:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\phpStudy\PHPTutorial\WWW\Laravel\node_modules\.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\phpStudy\PHPTutorial\php\php-7.2.1-nts;D:\composer;D:\Program Files (x86)\Yarn\bin\;D:\Program Files\nodejs\;D:\Program Files\Microsoft VS Code\bin;C:\Users\Administrator\AppData\Roaming\Composer\vendor\bin;C:\Users\Administrator\AppData\Local\Yarn\bin;C:\Users\Administrator\AppData\Roaming\npm
9 verbose lifecycle [[@](https://learnku.com/users/10240)](https://learnku.com/users/8278)~dev: CWD: D:\phpStudy\PHPTutorial\WWW\Laravel
10 silly lifecycle [[@](https://learnku.com/users/10240)](https://learnku.com/users/8278)~dev: Args: [ '/d /s /c', 'npm run development' ]
11 silly lifecycle [[@](https://learnku.com/users/10240)](https://learnku.com/users/8278)~dev: Returned: code: 2 signal: null
12 info lifecycle [[@](https://learnku.com/users/10240)](https://learnku.com/users/8278)~dev: Failed to exec dev script
13 verbose stack Error: [[@](https://learnku.com/users/10240)](https://learnku.com/users/8278) dev: `npm run development`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (D:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess.<anonymous> (D:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:961:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
14 verbose pkgid [[@](https://learnku.com/users/10240)](https://learnku.com/users/8278)
15 verbose cwd D:\phpStudy\PHPTutorial\WWW\Laravel
16 verbose Windows_NT 6.1.7600
17 verbose argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
18 verbose node v10.5.0
19 verbose npm v6.1.0
20 error code ELIFECYCLE
21 error errno 2
22 error [[@](https://learnku.com/users/10240)](https://learnku.com/users/8278) dev: `npm run development`
22 error Exit status 2
23 error Failed at the [[@](https://learnku.com/users/10240)](https://learnku.com/users/8278) dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
推荐文章: