简体   繁体   中英

Find linked NPM package

I have a bizarre issue.

I have written a package for Node for local use, and used NPM link to make it available for command line use globally.

Now I need to change the package, I can not find it on my drive but the package is still linked through NPM and usable.

Can NPM give me the path for linked modules?

As NPM uses symlinks, you can always see them with ls -l command in the console.

See details in the npm-link docs .

As someone mentioned above, The location of the Node.js files depends on the method you used to install it. I had the same issue and fixed it by locating the node_modules folder on my system and directly deleting the links.

If you downloaded and run, the installer package from the nodejs.org website, the Node.js main executables files -- node and npm -- are located on the /usr/local/bin folder.

Note that I am on MacOS, not sure about Windows though.

Here's a link for more information and reference: https://davescripts.com/location-of-nodejs-files-on-mac-os-x#:~:text=If%20you%20downloaded%20and%20run,usr%2Flocal%2Fbin%20folder .

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM