找不到模块“ ./opera”或“ ./safari”或其对应的类型声明

时间:2020-09-04 15:47:21

标签: node.js angular selenium selenium-webdriver

我尝试在Windows(select row_number() over (partition by col1 order by validfrom desc, insertdatetime desc) as rank )上构建我的项目,并总是出现错误:

ng build --prod

以及正在安装软件包时(ERROR in node_modules/@types/selenium-webdriver/index.d.ts:16:24 - error TS2307: Cannot find module './opera' or its corresponding type declarations. 16 import * as opera from './opera'; ~~~~~~~~~ node_modules/@types/selenium-webdriver/index.d.ts:17:25 - error TS2307: Cannot find module './safari' or its corresponding type declarations. 17 import * as safari from './safari'; ~~~~~~~~~~ ):

npm install

我试图清除缓存,以管理员身份运行npm WARN tar EPERM: operation not permitted, open 'C:\Users\...\node_modules\.staging\selenium-webdriver-6ef0540e\safari.js' npm WARN tar EPERM: operation not permitted, open 'C:\Users\...\node_modules\.staging\selenium-webdriver-28295b03\safari.js' npm WARN tar EPERM: operation not permitted, open 'C:\Users\...\node_modules\.staging\selenium-webdriver-87ecdeff\safari.js' npm WARN tar EPERM: operation not permitted, open 'C:\Users\...\node_modules\.staging\selenium-webdriver-28295b03\opera.js' npm WARN tar EPERM: operation not permitted, open 'C:\Users\...\node_modules\.staging\selenium-webdriver-87ecdeff\opera.js' ,删除npm inode_modules并以管理员身份运行package-lock.json。似乎我已经重试了这些动作的所有组合。但是没有任何帮助。

下面是我的npm i

package.json

我使用 Node.js v14.9.0 Angular v.10

为什么会发生此错误?以及如何在 Windows 上进行修复?所有功能都能在 MacOS Ubuntu CentOS

上完美运行

0 个答案:

没有答案