It's been about half a year since I used npm.
The other day, the local installation of the package did not work well on npm, so
I'd like some advice to fix it.
I was developing using npm+webpack in Windows 10.
After installing additional clean webpack plugins,
Immediately after installation, npm-scripts no longer functioning with webpack.
'webpack' is an internal or external command.
Not recognized as an operational program or batch file.
Here's what I tried to fix.
npmi
npmi
after removing Node.js completelyI checked the local node_modules and found that there were no webpack or other related package files.
When I tried creating a new project and ran npm init-y&npmi-D webpack
, the following files were generated (all contents are empty):
node_modules
- - @jridgewell
- -@types
- - @webassemblyjs
- - @xtuc
--.package-lock.json
Installing webpack globally generates webpack files within %APPDATA%\npm.
When I cloned a project on another PC and npmi
, I found that
The other PCs successfully installed the package locally.
Then, when I copied node_modules generated by other PCs to the defective PC,
It now works.
However, I cannot install the package on another device every time, so
I really want to fix it.
I'm sorry for the long letter.
Thank you for your cooperation.
Self-Solving
For some reason local installation was successful for other users, so
Created a batch to launch a command prompt from another user with the runas command.
runas/savecred/user:<Username>>cmd
As no direct solution has been reached,
If anyone knows the cause, please advise me.
© 2024 OneMinuteCode. All rights reserved.