-
Notifications
You must be signed in to change notification settings - Fork 284
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
NPM not recognized as an internal or external command #2642
Comments
@benoitcornette Hey, I saw your post about same problem (https://npm.community/t/npm-v-returns-error-message-perfix-g-is-not-recognized-as-an-internal-or-external-command/4820 ). I wonder if you had fixed it. I would appreciate you help very much. Thank you. |
How did you install node? |
This confirms my suspicions in the footnotes of https://github.com/nodejs/modules/issues/472#issuecomment-615950402. /cc @nodejs/modules-active-members as I was also experiencing this and discussion has begun about error messages in nodejs/node#32052 My questions is what team is responsible for module specifiers being fed to the node CLI as arguments? Specifically Windows absolute root paths and the associated translation to absolute file URL paths existing in |
I would very highly value the opinion of @weswigham on this seeing as how TypeScript has already done all this work for us. |
Maybe @nodejs/tsc would know as I haven't a clue about the various compatibility expectations here. |
Our path normalization code, as far as the string representation is concerned:
That's all. We do not make a URL/Path distinction in our codebase - a Path may implicitly be a URL. To whit, in many places where we want to attempt to do local disk lookups, we call an |
@lukanp I just reinstalled my virtual machine completely and after that, everything worked perfectly. |
I don't understand this issue. It seems this issue should be in help, but I might be wrong. Is there anything that we can do to prevent this from happening? @DerekNonGeneric I do not understand the question to the tsc. |
This seems like two separate issues to me? |
@lukanp, from your system variables: |
@lukanp Looking at your environment variables, I think the problem is related to your |
/to @mcollina
Thanks for your reply! There was no question. :)
There are problems on a few layers here. Judging by the title of the issue, the main concern seems to have been at the intersection of Here's the full-text output of the error from my image (similar to OP's 3rd image):
Those escape sequences ( I hope that was helpful. |
That is a known issue and unrelated to the issue from OP. I would suggest moving this to nodejs/help, as it seems to be a problem with environment variables configuration, especially if the OP can confirm that https://github.com/nodejs/node/issues/32952#issuecomment-617356737 is the cause. |
This may or may not be related, but importing absolute paths on windows is not supported by ESM: nodejs/node#31710 . Currently the fix would be to convert your path to a "absolute file specifier" by doing something like
|
/cc @addaleax as we now have a command associated w/ error message seen in #2266 |
@DerekNonGeneric I don’t really know that I can add any value here besides that a) this does belong in nodejs/help and I’ll move it there and b) this is an issue with Windows and/or npm, but not Node.js itself, as far as I can tell |
I tried a lot of the things you recommended to me but nothing worked to fix the problem. In the end, I reinstalled my system and that's how I fixed it. Thank you for your support and advice! |
I’ve installed latest version of NodeJS and I'm trying to install Angular CLI , but...
When i try to use NPM commands i always get this message:
'CALL “C:\Program Files\nodejs\node_modules \npm\bin\npm-cli.js” prefix -g' is not recognized as an internal or external command
and then command is executed.Here's an image
and when I try to instal Angular cli with "npm install -g @angular/cli" this happens:
and Angular's not working
PS: here's my Environment Variables
USER:
SYSTEM:
I don't know what could be a problem. Please help me...
Thank you.
The text was updated successfully, but these errors were encountered: