猿问

cnpm run dev出错!

跟着教程一步步来的~ 出现下面的错误


$ cnpm run dev

npm ERR! path C:\Users\acer\mall\package.json

npm ERR! code ENOENT

npm ERR! errno -4058

npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\acer\mall\package.json'

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent


npm ERR! A complete log of this run can be found in:

npm ERR!     C:\Users\acer\AppData\Roaming\npm-cache\_logs\2017-09-19T15_35_23_077Z-debug.log


慕圣9424722
浏览 8787回答 4
4回答

菜鸟教程

检查你项目目录底下的package.json,npm run dev 的配置在script里面。

慕圣9424722

确实是搞错目录了,重新在安装后再run就成功了..但是我ctrl c后重新cnpm run dev,又报错...$ cnpm run dev> mymall@1.0.0 dev C:\Users\acer\mall\mymall> node build/dev-server.jsnpm WARN invalid config loglevel="notice"> Starting dev server...events.js:160      throw er; // Unhandled 'error' event      ^Error: listen EADDRINUSE :::8080    at Object.exports._errnoException (util.js:1020:11)    at exports._exceptionWithHostPort (util.js:1043:20)    at Server._listen2 (net.js:1258:14)    at listen (net.js:1294:10)    at Server.listen (net.js:1390:5)    at EventEmitter.listen (C:\Users\acer\mall\mymall\node_modules\_express@4.15.4@express\lib\application.js:618:24)    at Object.<anonymous> (C:\Users\acer\mall\mymall\build\dev-server.js:83:18)    at Module._compile (module.js:570:32)    at Object.Module._extensions..js (module.js:579:10)    at Module.load (module.js:487:32)    at tryModuleLoad (module.js:446:12)    at Function.Module._load (module.js:438:3)    at Module.runMain (module.js:604:10)    at run (bootstrap_node.js:389:7)    at startup (bootstrap_node.js:149:9)    at bootstrap_node.js:502:3npm ERR! code ELIFECYCLEnpm ERR! errno 1npm ERR! mymall@1.0.0 dev: `node build/dev-server.js`npm ERR! Exit status 1npm ERR!npm ERR! Failed at the mymall@1.0.0 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!     C:\Users\acer\AppData\Roaming\npm-cache\_logs\2017-09-19T16_03_31_299Z-debug.log这个Error: listen EADDRINUSE :::8080,应该是端口被之前那个给占用了~ 这下咋办
随时随地看视频慕课网APP
我要回答