我最近改变了我的计算机,当我进入项目文件夹并运行命令时,我将我的Angular项目复制到新项目中:
ng serve --open
我有错误:
** NG Live Development Server is running on http://localhost:4200 **
10% building modules 3/3 modules 0 activeinternal/child_process.js:319
throw errnoException(err, 'spawn');
^
Error: spawn EACCES
at exports._errnoException (util.js:1050:11)
at ChildProcess.spawn (internal/child_process.js:319:11)
at Object.exports.spawn (child_process.js:378:9)
at module.exports (/localdata/hasanh/Documents/websites/Angular tests/BooksStore/node_modules/opn/index.js:75:24)
at Server.server.listen (/localdata/hasanh/Documents/websites/Angular tests/BooksStore/node_modules/@angular/cli/tasks/serve.js:169:21)
at Object.onceWrapper (events.js:293:19)
at emitNone (events.js:86:13)
at Server.emit (events.js:188:7)
at emitListeningNT (net.js:1286:10)
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
但是有了命令:
npm start
项目正常,我试着做
npm install
npm serve --open
在项目文件夹中但仍无法正常工作?
感谢您的帮助
GR
答案 0 :(得分:0)
您可以尝试以下解决方案:
您可以尝试更改端口号
" start":" live-server --port = 8181"
尝试使用sudo
进行安装sudo npm install
sudo npm serve --open
答案 1 :(得分:0)
感谢您的帮助,它适用于命令:
ng serve --port=8181
此致 的Gr