【发布时间】:2020-09-27 09:14:22
【问题描述】:
为了 sass 编译,我安装了 node.js,我现在还没有接触过任何 javascript,所以我为解决这个问题而经历的所有文档对我来说真的很复杂。因此,当我将 npm init -y 命令放入 VScode 终端时,它会安装 package.json 文件,该文件在第 5 行和第 6 行之间具有调试属性。
当我点击终端时显示的“调试”错误是这些......
"Error: no test specified"
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! c@1.0.0 test: `echo "Error: no test specified" && exit 1`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the c@1.0.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\AppData\Roaming\npm-cache\_logs\2020-09-27T00_42_32_091Z-debug.log
Waiting for the debugger to disconnect...
PS C:\Users\Desktop\c>
这里是日志文件
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'test'
1 verbose cli ]
2 info using npm@6.14.8
3 info using node@v14.11.0
4 verbose run-script [ 'pretest', 'test', 'posttest' ]
5 info lifecycle c@1.0.0~pretest: c@1.0.0
6 info lifecycle c@1.0.0~test: c@1.0.0
7 verbose lifecycle c@1.0.0~test: unsafe-perm in lifecycle true
8 verbose lifecycle c@1.0.0~test: PATH: C:\Users\\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\\Desktop\c\node_modules\.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\\AppData\Local\Microsoft\WindowsApps;C:\Users\\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\\AppData\Roaming\npm
9 verbose lifecycle c@1.0.0~test: CWD: C:\Users\\Desktop\c
10 silly lifecycle c@1.0.0~test: Args: [ '/d /s /c', 'echo "Error: no test specified" && exit 1' ]
11 silly lifecycle c@1.0.0~test: Returned: code: 1 signal: null
12 info lifecycle c@1.0.0~test: Failed to exec test script
13 verbose stack Error: c@1.0.0 test: `echo "Error: no test specified" && exit 1`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:314:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:314:20)
13 verbose stack at maybeClose (internal/child_process.js:1047:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid c@1.0.0
15 verbose cwd C:\Users\\Desktop\c
16 verbose Windows_NT 10.0.19041
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "test"
18 verbose node v14.11.0
19 verbose npm v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error c@1.0.0 test: `echo "Error: no test specified" && exit 1`
22 error Exit status 1
23 error Failed at the c@1.0.0 test script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
【问题讨论】: