【发布时间】:2023-04-28 07:32:02
【问题描述】:
我在 Mac 上关注 VUE tutorial(在 youtube 中显示)。
在我的src/app.js 我只有console.log('hi');
如 youtube 视频所示,package.json 中 Mac 的启动命令是:
"scripts": {
"start": "./node_modules/nodemon/bin/nodemon.js src/app.js --exec 'npm run lint && node'",
"lint": "./node_modules/.bin/eslint **/*.js"
},
在这种情况下找不到 nodemon。
所以我将正斜杠改为反斜杠:
"scripts": {
"start": ".\\node_modules\\nodemon\\bin\\nodemon.js src\\app.js --exec 'npm run lint && node'",
"lint": ".\\node_modules\\.bin\\eslint **\\*.js"
},
但现在当我运行 npm start 时,我收到了 nodemon.js 中的错误警报
line 1
charachter 1
invalid character
800A03F6
我尝试在 src/app.js 中使用正斜杠并得到同样的错误。它与单引号有关吗?
教程在这里:(启动命令见于 21:43)这里:https://www.youtube.com/watch?v=Fa4cRMaTDUI&t=21m43s
【问题讨论】:
-
这个问题适用于任何使用 nodemon 的应用程序:VUE、React 等。
标签: nodemon invalid-characters npm-start