简体   繁体   中英

Error while installing the node modules in Jenkins

I have a job in Jenkins that runs the protractor tests. During some bug fix, I removed the node_modules by using the shell command rm -rf node_modules/. Now I am trying to install the node_modules again by using the command npm install. During this installation, for every module it is installing I can see the comment as 'The package has been renamed to open '. I am not sure why is it coming up.

Once the installation is done, on the execution of the command 'webdriver-manager update --standalone false --gecko false' , it is throwing an error saying the module 'rimraf' is not available, which is a bit strange as I can see that is already installed.

What could be the issue ? How can I overcome this problem?

I tried clearing cache to make sure that it is not influenced by cache. checked the node_modules folder to make sure that the names of all the modules are correct and not open. Checked with all the possible commands to install the node modules.

11:44:51 npm WARN deprecated acorn-dynamic-import@4.0.0: The package has been renamed to `open`
11:44:51 npm WARN deprecated app-root-path@2.2.1: The package has been renamed to `open`
11:44:51 npm WARN deprecated arraybuffer.slice@0.0.7: The package has been renamed to `open`
11:44:51 npm WARN deprecated blob@0.0.5: The package has been renamed to `open`
11:44:51 npm WARN deprecated browser-resolve@1.11.3: The package has been renamed to `open`
11:44:51 npm WARN deprecated util@0.10.4: The package has been renamed to `open`
11:44:51 npm WARN deprecated buffer-more-ints@1.0.0: The package has been renamed to `open`
11:44:51 npm WARN deprecated cached-path-relative@1.0.2: The package has been renamed to `open`
11:44:51 npm WARN deprecated circular-json@0.5.9: The package has been renamed to `open`
11:44:51 npm WARN deprecated code-block-writer@7.3.1: The package has been renamed to `open`
11:44:51 npm WARN deprecated command-exists@1.2.8: The package has been renamed to `open`
11:44:51 npm WARN deprecated data-uri-to-buffer@2.0.1: The package has been renamed to `open`
11:44:51 npm WARN deprecated diff@3.5.0: The package has been renamed to `open`
11:44:51 npm WARN deprecated fastparse@1.1.2: The package has been renamed to `open`
11:44:51 npm WARN deprecated clone@1.0.4: The package has been renamed to `open`
11:44:51 npm WARN deprecated engine.io-parser@2.1.3: The package has been renamed to `open`
11:44:51 npm WARN deprecated https-proxy-agent@2.2.1: The package has been renamed to `open`
11:44:51 npm WARN deprecated buffer@5.2.1: The package has been renamed to `open`
11:44:51 npm WARN deprecated crc@3.8.0: The package has been renamed to `open`
11:44:51 npm WARN deprecated ini@1.3.5: The package has been renamed to `open`
11:44:51 npm WARN deprecated generate-function@2.3.1: The package has been renamed to `open`
11:44:51 npm WARN deprecated isbinaryfile@3.0.3: The package has been renamed to `open`
11:44:51 npm WARN deprecated jasmine-core@2.8.0: The package has been renamed to `open`
11:44:51 npm WARN deprecated opn@6.0.0: The package has been renamed to `open`
11:44:51 npm WARN deprecated make-error@1.3.5: The package has been renamed to `open`
11:44:51 npm WARN deprecated merge2@1.2.3: The package has been renamed to `open`
11:44:51 npm WARN deprecated debug@3.1.0: The package has been renamed to `open`
11:44:51 npm WARN deprecated http-proxy-agent@2.1.0: The package has been renamed to `open`
11:44:52 npm WARN deprecated nice-try@1.0.5: The package has been renamed to `open`
11:44:52 npm WARN deprecated istanbul-lib-report@1.1.5: The package has been renamed to `open`
11:44:52 npm WARN deprecated @types/node@6.14.6: The package has been renamed to `open`
11:44:52 npm WARN deprecated adm-zip@0.4.13: The package has been renamed to `open`
11:44:52 npm WARN deprecated qjobs@1.2.0: The package has been renamed to `open`
11:44:52 npm WARN deprecated regenerate@1.4.0: The package has been renamed to `open`
11:44:52 npm WARN deprecated css-selector-tokenizer@0.7.1: The package has been renamed to `open`
11:44:52 npm WARN deprecated basic-auth@2.0.1: The package has been renamed to `open`
11:44:52 npm WARN deprecated morgan@1.9.1: The package has been renamed to `open`
11:47:35 + npm run e2e -- --suite=validateObjects --baseUrl=*******
11:47:36 
11:47:36 > solaris@1.0.0 pree2e /var/jenkins_home/workspace/Solaris Protractor tests - IFD Test
11:47:36 > webdriver-manager update --standalone false --gecko false
11:47:36 
11:47:36 module.js:478
11:47:36     throw err;
11:47:36     ^
11:47:36 
11:47:36 Error: Cannot find module 'rimraf'
11:47:36     at Function.Module._resolveFilename (module.js:476:15)
11:47:36     at Function.Module._load (module.js:424:25)
11:47:36     at Module.require (module.js:504:17)
11:47:36     at require (internal/module.js:20:19)
11:47:36     at Object.<anonymous> (/var/jenkins_home/workspace/Solaris Protractor tests - IFD Test/node_modules/protractor/node_modules/webdriver-manager/built/lib/binaries/android_sdk.js:4:16)
11:47:36     at Module._compile (module.js:577:32)
11:47:36     at Object.Module._extensions..js (module.js:586:10)
11:47:36     at Module.load (module.js:494:32)
11:47:36     at tryModuleLoad (module.js:453:12)
11:47:36     at Function.Module._load (module.js:445:3)
11:47:36 

I searched that error and a package called opn which is now deprecated came up, check out the author message . I am guessing this is due to your package-lock.json file referencing older versions of packages which are still calling the original opn package.

Would it be acceptable for you to remove the package-lock.json and try npm install once more?

Thanks for your inputs.

I got the issue solved and the reason is quite simple.

figured out that the node versions are different from Jenkins and the workspace and hence this issue has occurred. on using the node version from Jenkins, I am able to execute the tests.

Hope this helps someone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM