我正在尝试安装w3c的respec项目的依赖项,我收到此错误
npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.
npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.
npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.
> respec@19.6.0 prepublish C:\Users\MUJ\Desktop\respec
> npm run snyk-protect
> respec@19.6.0 snyk-protect C:\Users\MUJ\Desktop\respec
> snyk protect
Snyk couldn't patch the specified vulnerabilities because GNU's patch is not available. Please install 'patch' and try again.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! respec@19.6.0 snyk-protect: `snyk protect`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the respec@19.6.0 snyk-protect script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! respec@19.6.0 prepublish: `npm run snyk-protect`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the respec@19.6.0 prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
我尝试使用给定的命令安装补丁。这是我每次运行时都会得到的结果" npm install patch"
C:\Users\MUJ\Desktop\respec>npm install patch
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ patch@0.0.1
added 1 package in 22.255s
C:\Users\MUJ\Desktop\respec>npm install
npm WARN rollback Rolling back ajv@4.11.8 failed (this is probably harmless): EPERM: operation not permitted, rmdir 'C:\Users\MUJ\Desktop\respec\node_modules\fsevents\node_modules'
npm WARN rollback Rolling back tar-pack@3.4.0 failed (this is probably harmless): EPERM: operation not permitted, rmdir 'C:\Users\MUJ\Desktop\respec\node_modules\fsevents\node_modules'
npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.
npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.
> respec@19.6.0 prepublish C:\Users\MUJ\Desktop\respec
> npm run snyk-protect
> respec@19.6.0 snyk-protect C:\Users\MUJ\Desktop\respec
> snyk protect
Snyk couldn't patch the specified vulnerabilities because GNU's patch is not available. Please install 'patch' and try again.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! respec@19.6.0 snyk-protect: `snyk protect`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the respec@19.6.0 snyk-protect script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! respec@19.6.0 prepublish: `npm run snyk-protect`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the respec@19.6.0 prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
我该怎么做才能解决这个问题?
答案 0 :(得分:0)
这不是npm问题:这是Windows操作系统二进制问题。 this post here已涵盖此问题。
基本上,您需要在环境%PATH%变量上使用patch.exe。
如果您还没有安装它们,似乎可以找到它们here。
干杯。