我在詹金斯(Jenkins)工作,负责量角器测试。在进行一些错误修复期间,我使用shell命令rm -rf node_modules /删除了node_modules。
现在,我尝试使用命令npm install重新安装node_modules。在此安装过程中,对于要安装的每个模块,我都会看到以下注释:“程序包已重命名为open
”。我不确定为什么会这样。
安装完成后,在执行命令'webdriver-manager update --standalone false --gecko false'时,抛出错误,表明模块'rimraf'不可用,这有点奇怪如我所见,已经安装了。
可能是什么问题?我该如何克服这个问题?
我尝试清除缓存以确保它不受缓存影响。检查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
答案 0 :(得分:2)
我搜索了该错误,然后出现了一个已被弃用的名为opn
的软件包,请检查author message。我猜这是由于您的package-lock.json文件引用了较旧的版本,这些版本仍在调用原始opn
程序包。
您可以删除package-lock.json
并再次尝试npm install
吗?
答案 1 :(得分:0)
感谢您的输入。
我解决了问题,原因很简单。
发现节点版本不同于Jenkins和工作空间,因此发生了此问题。关于使用Jenkins的节点版本,我能够执行测试。
希望这对某人有帮助。