最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - npm run test - unsafe-perm in lifecycle - Stack Overflow

programmeradmin0浏览0评论

I have a Reac/Redux app that runs fine, however when I run the following mand

npm run test

I get the following error

6 info lifecycle [email protected]~test: [email protected]
7 verbose lifecycle [email protected]~test: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~test: PATH: C:\....\...
9 verbose lifecycle [email protected]~test: CWD: C:\projects\MyApp\MyApp\MyApp-web
10 silly lifecycle [email protected]~test: Args: [ '/d /s /c', 'mocha --require src/testSetup.js "src/**/*.test.js*" ' ]
11 silly lifecycle [email protected]~test: Returned: code: 1  signal: null
12 info lifecycle [email protected]~test: Failed to exec test script
13 verbose stack Error: [email protected] test: `mocha --require src/testSetup.js "src/**/*.test.js*" `
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\....\NodeJs\12.1.0\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:196:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\....\NodeJs\12.1.0\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:196:13)
13 verbose stack     at maybeClose (internal/child_process.js:1000:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)

I don't know what is causing this issue. Any idea how I can resolve this error?

I have a Reac/Redux app that runs fine, however when I run the following mand

npm run test

I get the following error

6 info lifecycle [email protected]~test: [email protected]
7 verbose lifecycle [email protected]~test: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~test: PATH: C:\....\...
9 verbose lifecycle [email protected]~test: CWD: C:\projects\MyApp\MyApp\MyApp-web
10 silly lifecycle [email protected]~test: Args: [ '/d /s /c', 'mocha --require src/testSetup.js "src/**/*.test.js*" ' ]
11 silly lifecycle [email protected]~test: Returned: code: 1  signal: null
12 info lifecycle [email protected]~test: Failed to exec test script
13 verbose stack Error: [email protected] test: `mocha --require src/testSetup.js "src/**/*.test.js*" `
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\....\NodeJs\12.1.0\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:196:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\....\NodeJs\12.1.0\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:196:13)
13 verbose stack     at maybeClose (internal/child_process.js:1000:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)

I don't know what is causing this issue. Any idea how I can resolve this error?

Share Improve this question asked Jul 27, 2020 at 13:00 AryaArya 8,99532 gold badges114 silver badges187 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 3

i hope this can help you, i found out my issue was the version of nodejs i was using. I decided to install nvm(Node Version Manager) to "switch" versions and downgraded to the 11.13.0, and it finally worked.

I have same problem

1:clear npm cache

npm cache clean --force

2:Update Node.js

3:remove node_modules folder and run npm i again

4:probebly you have some error in terminal before show to you log file and require stack like this -> Error: Cannot find module '@babel/core'

I install this package again

I had to set nvm default to 14. nvm alias default 14.18 I cant be certain when the issue started but I did install nvm recently.

发布评论

评论列表(0)

  1. 暂无评论