I am trying to publish a module to npm registry. Before publishing I tried npm link
command to install it as a local dependency.
Running the command started throwing errors similar to following.
WARN tar EISDIR: illegal operation on a directory, open '/[[path_to_project]]/node_modules/.staging/@babel/plugin-transform-exponentiation-operator-049e5354/lib'
npm WARN rm not removing /[[path_to_project]]/node_modules/.bin/semver as it wasn't installed by /[[path_to_project]]/node_modules/semver
test-pkg@1.0.0 requires a peer of react@16.7.0 but none is installed. You must install peer dependencies yourself.
npm WARN test-pkg@1.0.0 requires a peer of react-dom@16.7.0 but none is installed. You must install peer dependencies yourself. npm WARN test-pkg@1.0.0 No description
I spent hours trying to fix this but no luck yet. I went through this post and removed .npmrc but that did not fix the issue.
Removing .npmrc
, deleting and reinstalling node_modules
did not work for me.
I solved this problem by setting --production flag as npm link --production"
And also yarn link
worked without any issue. Hope this helps if someone is having the same problem.
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.