1

First of all, I did see the similar documents:

Node.js TypeError: Object function Object() { [native code] } has no method 'assign'

TypeError: Object function Object() { [native code] } has no method 'method'

However..

I am using node version 0.10.48 (my app uses deprecated node api so I rather stay on this version).

whenever I try to install a new module, or even run scripts that require modules, I receive the following error: typeerror object function object() native code has no method 'assign'

I cannot even use npm v or npm install/uninstall..

How do I get rid of this error? I simply cannot do anything on the terminal :(

6
  • I would try reinstalling Node 0.10.48 so that it ensures you have the correct version of npm. Also make sure you're not trying to install modules that don't support 0.10.48 Commented Jul 11, 2017 at 19:53
  • 1
    @PatrickRoberts I cannot install anything.. any time I'm trying to use npm XXX i get this error (sudo does not help) Commented Jul 11, 2017 at 20:03
  • were you upgrading an old version? Commented Jul 11, 2017 at 20:05
  • From your browser, download the installer... in 0.10.48, you cannot use npm install npm, you must install it alongside Node Commented Jul 11, 2017 at 20:05
  • @PatrickRoberts Oh, haven't tought about that. I've installed the file and got in the 'bin/' folder 'node' exectuable and 'npm' files. How do I install this files? Commented Jul 11, 2017 at 20:17

1 Answer 1

0

You could try this: https://nodejs.org/en/download/package-manager/#osx

curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"

Worked for me on Amazon Linux as well (different command).

issues17886 (https://github.com/npm/npm/issues/17996)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.