# Npm install local-directory no longer makes symbolic links

**URL:** <https://discourse.nodered.org/t/npm-install-local-directory-no-longer-makes-symbolic-links/75615>\
**Category:** Developing Nodes\
**Created:** [23 February 2023 06:14 UTC](https://discourse.nodered.org/t/npm-install-local-directory-no-longer-makes-symbolic-links/75615 "2023-02-23T06:14:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris.willing](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chris.willing/32/76579_2.png) [@chris.willing](https://discourse.nodered.org/u/chris.willing)\
**Post date:** [23 February 2023 06:14 UTC](https://discourse.nodered.org/t/npm-install-local-directory-no-longer-makes-symbolic-links/75615/1 "2023-02-23T06:14:02Z")

</div>

For a long time I've been running `npm install some-local-directory` from ~/.node-red, which creates a symbolic link to some-local-directory where I'm doing my node development. With npm 9.4.0 (companion to nodejs 19.6.1) this is no longer the case; it looks like a plain copy is done instead. Therefore changes in some-local-directory have no effect on a restarted node-red.

As a work around, I've installed an older nodejs/npm version with nvm. The previous behaviour has been restored and my development workflow works again.

Does anyone know a better long term solution to the new npm behaviour?

chris

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 February 2023 07:08 UTC](https://discourse.nodered.org/t/npm-install-local-directory-no-longer-makes-symbolic-links/75615/2 "2023-02-23T07:08:17Z")

</div>

I think the better workaround might be to use one of the supported versions of nodejs that are supported by node red (18 for example). Then wait and see what the next LTS version brings. That change could be reverted.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [23 February 2023 09:37 UTC](https://discourse.nodered.org/t/npm-install-local-directory-no-longer-makes-symbolic-links/75615/3 "2023-02-23T09:37:36Z")

</div>

> [@chris.willing](#):
>
> Does anyone know a better long term solution to the new npm behaviour?

As Colin says, don't use odd numbered node.js versions and the npm versions that come with them since they often break things and breaking changes don't always end up landing in the next stable release.

That is the case here. There was indeed a change that meant that `npm install` on a local package installed a copy (which is also what a normal install does) rather than a pointer to the actual folder.

This broke several things and has been reversed.

[NPM 9 update in 18.14.0 broke `npm ci` with local dependencies · Issue #46542 · nodejs/node (github.com)](https://github.com/nodejs/node/issues/46542),  
[NPM 9 update in 18.14.0 broke `npm ci` with local dependencies · Issue #46542 · nodejs/node (github.com)](https://github.com/nodejs/node/issues/46542)

BTW, a local install doesn't create a link, that's what `npm link` does. It actually references the local folder. In the past I had a lot of issues with `npm link`, at least on Windows, as it did some very strange double linking.

---

<div class="post-metadata">

**Author:** ![chris.willing](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chris.willing/32/76579_2.png) [@chris.willing](https://discourse.nodered.org/u/chris.willing)\
**Post date:** [23 February 2023 12:42 UTC](https://discourse.nodered.org/t/npm-install-local-directory-no-longer-makes-symbolic-links/75615/4 "2023-02-23T12:42:51Z")

</div>

OK thank you all.

Interesting that NodeJS 18, an LTS, contains NPM 9 - an odd numbered (non-LTS?) version. Anyway, I just tried the same thing with 18.14.2 and that seems to have worked OK.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 February 2023 13:56 UTC](https://discourse.nodered.org/t/npm-install-local-directory-no-longer-makes-symbolic-links/75615/5 "2023-02-23T13:56:04Z")

</div>

`npm` doesn't follow quite the same odd/even numbering that `node.js` does. The two are separately managed projects.

The currently stable version of `npm` is v9.

You would have hit the same issue if you were running Node.js 18.14.0.

If you read through the history of the issue linked above, this was an intended change in behaviour that had a wider than expected impact, so they reverted.

---

<div class="post-metadata">

**Author:** ![chris.willing](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chris.willing/32/76579_2.png) [@chris.willing](https://discourse.nodered.org/u/chris.willing)\
**Post date:** [24 February 2023 03:38 UTC](https://discourse.nodered.org/t/npm-install-local-directory-no-longer-makes-symbolic-links/75615/6 "2023-02-24T03:38:59Z")

</div>

🆗 thanks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 March 2023 03:39 UTC](https://discourse.nodered.org/t/npm-install-local-directory-no-longer-makes-symbolic-links/75615/7 "2023-03-10T03:39:23Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
