当我尝试运行yarn start
时,我在命令行中看到一条错误,指出存在语法错误。
我尝试更新节点和纱线。
$ node --max_old_space_size=8192 ./node_modules/.bin/ng serve -H 0.0.0.0 --disable-host-check
C:\Users\OMARSaid\cui-shell-ui-develop\node_modules\.bin\ng:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')");
^^^^^^^
SyntaxError: missing ) after argument list
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.```
I expect for it to run properly since there was no modification done.
答案 0 :(得分:0)
使用来自nodejs的路径模块,而不是直接称为“目录名”
const path = require('path');
path.resolve(__dirname);
并检查您的代码是否显示语法错误。希望它可以纠正。