npm run dev 后修改保存文件报错
发布于 7 年前 作者 JZLeung 5148 次浏览 来自 问答

用vue-cli新建的项目,然后 npm i 装到 phamtom.js 的时候报错。然后安装成功后, npm run dev 正常,但是只要修改过文件就会报下面的错误。

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/8.1.2/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'dev' ]
2 info using npm@5.3.0
3 info using node@v8.1.2
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle vuex-cnode@1.0.0~predev: vuex-cnode@1.0.0
6 info lifecycle vuex-cnode@1.0.0~dev: vuex-cnode@1.0.0
7 verbose lifecycle vuex-cnode@1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle vuex-cnode@1.0.0~dev: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/lynnleung/workspace/vuex-cnode/node_modules/.bin:/Users/lynnleung/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle vuex-cnode@1.0.0~dev: CWD: /Users/lynnleung/workspace/vuex-cnode
10 silly lifecycle vuex-cnode@1.0.0~dev: Args: [ '-c', 'node build/dev-server.js' ]
11 silly lifecycle vuex-cnode@1.0.0~dev: Returned: code: 1  signal: null
12 info lifecycle vuex-cnode@1.0.0~dev: Failed to exec dev script
13 verbose stack Error: vuex-cnode@1.0.0 dev: `node build/dev-server.js`
13 verbose stack Exit status 1
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:897:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
14 verbose pkgid vuex-cnode@1.0.0
15 verbose cwd /Users/lynnleung/workspace/vuex-cnode
16 verbose Darwin 16.6.0
17 verbose argv "/usr/local/Cellar/node/8.1.2/bin/node" "/usr/local/bin/npm" "run" "dev"
18 verbose node v8.1.2
19 verbose npm  v5.3.0
20 error code ELIFECYCLE
21 error errno 1
22 error vuex-cnode@1.0.0 dev: `node build/dev-server.js`
22 error Exit status 1
23 error Failed at the vuex-cnode@1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

有没有什么解决办法?

1 回复

我是在 phantom 安装失败后: npm install phantomjs-prebuilt@2.1.14 --ignore-scripts 这么安装成功,其他项目都是正常的,但是就这个新的项目不行。

回到顶部