Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"TypeError: path must be a string or Buffer" with installation. #2459

Closed
minhoryang opened this issue Oct 1, 2016 · 12 comments
Closed

"TypeError: path must be a string or Buffer" with installation. #2459

minhoryang opened this issue Oct 1, 2016 · 12 comments

Comments

@minhoryang
Copy link

minhoryang commented Oct 1, 2016

OS?

Ubuntu 14.04.2 LTS

$ uname -a
Linux spy 3.13.0-68-generic #111-Ubuntu SMP Fri Nov 6 18:17:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Versions.

angular-cli@1.0.0-beta.16

$ node --version
v6.7.0
$ npm --version
3.10.8
$ pnpm --version
0.37.0

Repro steps.

$ ndenv local v6.7.0
$ npm install -g pnpm
$ ndenv rehash
$ pnpm install angular-cli
$ ng --version

The log given by the failure.

$ ng --version
fs.js:640
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
TypeError: path must be a string or Buffer
    at TypeError (native)
    at Object.fs.openSync (fs.js:640:18)
    at Object.fs.readFileSync (fs.js:508:33)
    at Function.Version.fromProject (/home/minhoryang/NODE_PLAYGROUND/node_modules/angular-cli/upgrade/version.js:87:31)
    at Function.Version.isPreWebpack (/home/minhoryang/NODE_PLAYGROUND/node_modules/angular-cli/upgrade/version.js:111:31)
    at Function.Version.assertPostWebpackVersion (/home/minhoryang/NODE_PLAYGROUND/node_modules/angular-cli/upgrade/version.js:97:18)
    at /home/minhoryang/NODE_PLAYGROUND/node_modules/angular-cli/bin/ng:25:15
    at /home/minhoryang/NODE_PLAYGROUND/node_modules/angular-cli/node_modules/resolve/lib/async.js:44:21
    at ondir (/home/minhoryang/NODE_PLAYGROUND/node_modules/angular-cli/node_modules/resolve/lib/async.js:187:31)
    at /home/minhoryang/NODE_PLAYGROUND/node_modules/angular-cli/node_modules/resolve/lib/async.js:153:39

Mention any other details that might be useful.

When I searched this TypeError, I got these: #2324 #1941 #2135

@minhoryang
Copy link
Author

@minhoryang
Copy link
Author

$ npm install angular-cli

also happened without pnpm

@minhoryang
Copy link
Author

$ npm install -g angular-cli

works... :(

@minhoryang
Copy link
Author

why?

@minhoryang
Copy link
Author

With global installed angular-cli won't call Version.fromProject which was raising TypeError.

@minhoryang
Copy link
Author

Oh! He already knew this

@sonnenfeld269
Copy link

@minhoryang did u find a solution?

@minhoryang
Copy link
Author

@sonnenfeld269 you can bypass this with globally installation (-g), but I can't find the root causes.

@vadost
Copy link

vadost commented Oct 3, 2016

I have the same problem with globally installation(

@vadost
Copy link

vadost commented Oct 5, 2016

I solved the problem this way:
Simplest workaround to continue working in your project is comment line 25 of node_modules/angular-cli/bin/ng :
// Version.assertPostWebpackVersion();
Until it is fixed properly.​​

@filipesilva
Copy link
Contributor

Dupe of #2135

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants