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

Double Quote Symbolic Path Links for Windows to Work #6601

Closed
wants to merge 11 commits into from

Conversation

natesire
Copy link

@natesire natesire commented Jun 23, 2023

I had to double quote these regular expressions to work on Windows. Can we use Windows Symbolic Links instead of these files that contain directory paths?

Screenshot 2023-06-22 201219

Screenshot 2023-06-22 201504

#4234

@fritzy

I had to double quote these regular expressions for them to work on Windows.
I had to double quote these regular expressions to work on Windows. Windows doesn't have symbolic links.
I had to double quote these regular expressions to work on Windows. Windows doesn't have symbolic links.
I had to double quote these regular expressions to work on Windows. Windows doesn't have symbolic links.
I had to double quote these regular expressions to work on Windows. Windows doesn't have symbolic links.
I had to double quote these regular expressions to work on Windows. Windows doesn't have symbolic links.
I had to double quote these regular expressions to work on Windows. Windows doesn't have symbolic links.
I had to double quote these regular expressions to work on Windows. Windows doesn't have symbolic links.
I had to double quote these regular expressions to work on Windows. Windows doesn't have symbolic links.
@ljharb
Copy link
Contributor

ljharb commented Jun 23, 2023

@lukekarrys
Copy link
Contributor

There are some issues with local development for the repo on Windows w/r/t symlinks. I've fixed those and a few other things as part of #6586.

@lukekarrys lukekarrys closed this Jun 23, 2023
@natesire
Copy link
Author

Hi @lukekarrys After I worked around the broken symlink, I then ran into another error about the constructor not being found for Arborist. Just FYI.

@lukekarrys
Copy link
Contributor

Hi @lukekarrys After I worked around the broken symlink, I then ran into another error about the constructor not being found for Arborist. Just FYI.

Can you try with the latest branch? New commits have landed that should fix that issues as well.

@natesire
Copy link
Author

natesire commented Jul 9, 2023

Windows definitely has symbolic links and has for decades https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links

Hi @ljharb, I mean in the context of this work. It doesn't seem like the NPM packages are utilizing Windows symbolic links. I looked over the changes from Node 16.13.0 to Node 20+... and the same directories were deleted and replaced with these file to directory placeholders.

several lib* directories

Now my CLI is saying Arborist is not a constructor. It's not loading the classes properly even after reading these simulated symbolic placeholders on Windows. It was working when they were just directories on Node 16.13. I isolated the break between Node 16.13 and Node 16.14 when NPM jumped from:

node 16.13.0
npm 7.24.2

TO

node 16.14.0
npm 8.3.1

I have to workaround this with Yarn because I cannot troubleshoot anything on NPM since the CLI is not working when it starts loading the packages.... e.g. "npm i"

As soon as I upgrade Node and NPM... the CLI mostly falls over whenever it tries to traverse the file tree structure with Arborist.

@natesire
Copy link
Author

natesire commented Jul 9, 2023

PS C:\Users\nates\github\20> npm install npm@latest -g
ERROR: npm v9.6.7 is known not to run on Node.js v20.3.1. This version of npm supports the following node versions: ^14.17.0 || ^16.13.0 || >=18.0.0. You can find the latest version at https://nodejs.org/.

ERROR:
C:\Users\nates\AppData\Roaming\nvm\v20.3.1\node_modules\npm\node_modules@npmcli\config:1
../../workspaces/config
^

SyntaxError: Unexpected token '.'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1177:20)
at Module._compile (node:internal/modules/cjs/loader:1221:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
at Module.load (node:internal/modules/cjs/loader:1115:32)
at Module._load (node:internal/modules/cjs/loader:962:12)
at Module.require (node:internal/modules/cjs/loader:1139:19)
at require (node:internal/modules/helpers:121:18)
at Object. (C:\Users\nates\AppData\Roaming\nvm\v20.3.1\node_modules\npm\lib\npm.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1257:14)

ERROR: npm v9.6.7 is known not to run on Node.js v20.3.1. This version of npm supports the following node versions: ^14.17.0 || ^16.13.0 || >=18.0.0. You can find the latest version at https://nodejs.org/.

ERROR:
C:\Users\nates\AppData\Roaming\nvm\v20.3.1\node_modules\npm\node_modules@npmcli\config:1
../../workspaces/config
^

SyntaxError: Unexpected token '.'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1177:20)
at Module._compile (node:internal/modules/cjs/loader:1221:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
at Module.load (node:internal/modules/cjs/loader:1115:32)
at Module._load (node:internal/modules/cjs/loader:962:12)
at Module.require (node:internal/modules/cjs/loader:1139:19)
at require (node:internal/modules/helpers:121:18)
at Object. (C:\Users\nates\AppData\Roaming\nvm\v20.3.1\node_modules\npm\lib\npm.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1257:14)

PS C:\Users\nates\github\20> yarn add npm@latest -g
yarn add v1.22.19
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning Workspaces can only be enabled in private projects.
[4/4] Building fresh packages...
success Saved lockfile.
warning Workspaces can only be enabled in private projects.
success Saved 1 new dependency.
info Direct dependencies
└─ npm@9.8.0
info All dependencies
└─ npm@9.8.0
Done in 1.75s.
PS C:\Users\nates\github\20> npm -v
ERROR: npm v9.6.7 is known not to run on Node.js v20.3.1. This version of npm supports the following node versions: ^14.17.0 || ^16.13.0 || >=18.0.0. You can find the latest version at https://nodejs.org/.

ERROR:
C:\Users\nates\AppData\Roaming\nvm\v20.3.1\node_modules\npm\node_modules@npmcli\config:1
../../workspaces/config
^

SyntaxError: Unexpected token '.'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1177:20)
at Module._compile (node:internal/modules/cjs/loader:1221:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
at Module.load (node:internal/modules/cjs/loader:1115:32)
at Module._load (node:internal/modules/cjs/loader:962:12)
at Module.require (node:internal/modules/cjs/loader:1139:19)
at require (node:internal/modules/helpers:121:18)
at Object. (C:\Users\nates\AppData\Roaming\nvm\v20.3.1\node_modules\npm\lib\npm.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1257:14)

ERROR: npm v9.6.7 is known not to run on Node.js v20.3.1. This version of npm supports the following node versions: ^14.17.0 || ^16.13.0 || >=18.0.0. You can find the latest version at https://nodejs.org/.

ERROR:
C:\Users\nates\AppData\Roaming\nvm\v20.3.1\node_modules\npm\node_modules@npmcli\config:1
../../workspaces/config
^

SyntaxError: Unexpected token '.'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1177:20)
at Module._compile (node:internal/modules/cjs/loader:1221:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
at Module.load (node:internal/modules/cjs/loader:1115:32)
at Module._load (node:internal/modules/cjs/loader:962:12)
at Module.require (node:internal/modules/cjs/loader:1139:19)
at require (node:internal/modules/helpers:121:18)
at Object. (C:\Users\nates\AppData\Roaming\nvm\v20.3.1\node_modules\npm\lib\npm.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1257:14)

PS C:\Users\nates\github\20> ls

Directory: C:\Users\nates\github\20

Mode LastWriteTime Length Name


d----- 7/9/2023 9:28 AM node_modules
-a---- 7/8/2023 6:01 PM 676 package-lock.json
-a---- 7/9/2023 9:28 AM 267 package.json
-a---- 7/9/2023 9:28 AM 81166 yarn.lock

PS C:\Users\nates\github\20> rm .\package-lock.json
PS C:\Users\nates\github\20> yarn add npm@latest -g
yarn add v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning Workspaces can only be enabled in private projects.
[4/4] Building fresh packages...
warning Workspaces can only be enabled in private projects.
success Saved 1 new dependency.
info Direct dependencies
└─ npm@9.8.0
info All dependencies
└─ npm@9.8.0
Done in 1.70s.
PS C:\Users\nates\github\20> npm -v
ERROR: npm v9.6.7 is known not to run on Node.js v20.3.1. This version of npm supports the following node versions: ^14.17.0 || ^16.13.0 || >=18.0.0. You can find the latest version at https://nodejs.org/.

ERROR:
C:\Users\nates\AppData\Roaming\nvm\v20.3.1\node_modules\npm\node_modules@npmcli\config:1
../../workspaces/config
^

SyntaxError: Unexpected token '.'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1177:20)
at Module._compile (node:internal/modules/cjs/loader:1221:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
at Module.load (node:internal/modules/cjs/loader:1115:32)
at Module._load (node:internal/modules/cjs/loader:962:12)
at Module.require (node:internal/modules/cjs/loader:1139:19)
at require (node:internal/modules/helpers:121:18)
at Object. (C:\Users\nates\AppData\Roaming\nvm\v20.3.1\node_modules\npm\lib\npm.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1257:14)

ERROR: npm v9.6.7 is known not to run on Node.js v20.3.1. This version of npm supports the following node versions: ^14.17.0 || ^16.13.0 || >=18.0.0. You can find the latest version at https://nodejs.org/.

ERROR:
C:\Users\nates\AppData\Roaming\nvm\v20.3.1\node_modules\npm\node_modules@npmcli\config:1
../../workspaces/config
^

SyntaxError: Unexpected token '.'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1177:20)
at Module._compile (node:internal/modules/cjs/loader:1221:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
at Module.load (node:internal/modules/cjs/loader:1115:32)
at Module._load (node:internal/modules/cjs/loader:962:12)
at Module.require (node:internal/modules/cjs/loader:1139:19)
at require (node:internal/modules/helpers:121:18)
at Object. (C:\Users\nates\AppData\Roaming\nvm\v20.3.1\node_modules\npm\lib\npm.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1257:14)

PS C:\Users\nates\github\20> node -v
v20.3.1
PS C:\Users\nates\github\20>

@natesire
Copy link
Author

natesire commented Jul 9, 2023

PS C:\Users\nates\github\20> yarn
yarn install v1.22.19
[1/4] Resolving packages...
error Command failed.
Exit code: 128
Command: git
Arguments: clone https://github.com/npm/cli C:\Users\nates\AppData\Local\Yarn\Cache\v6.tmp\141b9f1d91e41dc93c467576d32d1e80
Directory: C:\Users\nates\github\20
Output:
Cloning into 'C:\Users\nates\AppData\Local\Yarn\Cache\v6.tmp\141b9f1d91e41dc93c467576d32d1e80'...
warning: unable to access 'workspaces/arborist/test/fixtures/links-all-over/node_modules/nest/node_modules/a/node_modules/b/node_modules/c/node_modules/d/node_modules/deep/node_modules/deep-a/.gitattributes': Filename too long
fatal: cannot create directory at 'workspaces/arborist/test/fixtures/testing-bundledeps-3/node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps/node_modules/@isaacs/testing-bundledeps-a': Filename too long
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

@natesire
Copy link
Author

natesire commented Jul 9, 2023

It's not allowing me to install the latest NPM version directly from the Github. It's getting hung up on Arborist again.

Windows and Linux allow for different max char paths.

@natesire
Copy link
Author

natesire commented Jul 9, 2023

This is on Linux

nate@mexico:/mnt/c/Users/nates/github/20$ yarn
yarn install v1.22.19
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
warning npm@9.8.0: Unable to read "./man" directory of module "npm"
[3/4] Linking dependencies...
warning Workspaces can only be enabled in private projects.
warning "npm@9.8.0" is missing a bundled dependency "@npmcli/arborist". This should be reported to the package maintainer.
warning "npm@9.8.0" is missing a bundled dependency "@npmcli/config". This should be reported to the package maintainer.
warning "npm@9.8.0" is missing a bundled dependency "libnpmaccess". This should be reported to the package maintainer.
warning "npm@9.8.0" is missing a bundled dependency "libnpmdiff". This should be reported to the package maintainer.
warning "npm@9.8.0" is missing a bundled dependency "libnpmexec". This should be reported to the package maintainer.
warning "npm@9.8.0" is missing a bundled dependency "libnpmfund". This should be reported to the package maintainer.
warning "npm@9.8.0" is missing a bundled dependency "libnpmhook". This should be reported to the package maintainer.
warning "npm@9.8.0" is missing a bundled dependency "libnpmorg". This should be reported to the package maintainer.
warning "npm@9.8.0" is missing a bundled dependency "libnpmpack". This should be reported to the package maintainer.
warning "npm@9.8.0" is missing a bundled dependency "libnpmpublish". This should be reported to the package maintainer.
warning "npm@9.8.0" is missing a bundled dependency "libnpmsearch". This should be reported to the package maintainer.
warning "npm@9.8.0" is missing a bundled dependency "libnpmteam". This should be reported to the package maintainer.
warning "npm@9.8.0" is missing a bundled dependency "libnpmversion". This should be reported to the package maintainer.
[4/4] Building fresh packages...
success Saved lockfile.
Done in 117.52s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants