Skip to content

fix(npm): use correct flags and update version for npm #5533

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

Merged
merged 5 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/build/build-standalone-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ main() {
ln -s "./lib/node" "$RELEASE_PATH/node"

pushd "$RELEASE_PATH"
yarn --production --frozen-lockfile
npm install --unsafe-perm --omit=dev
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'll help us catch this bug in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I didn't get to do this yet... It was on my to-do list from #5071 (comment) but hadn't gotten to it yet...

Copy link
Contributor Author

@jsjoeio jsjoeio Sep 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh don't worry! All good 👍🏼 We didn't realize it would cause other issues so no worries at all. At least it's only npm!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vaguely recall some issue with npm ci and optional dependencies; does that ring any bells?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think those were fixed with the latest versions of NPM, namely NPM 8 which we have since we bumped to NodeJS 16?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh gotcha!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
npm install --unsafe-perm --omit=dev
npm ci --unsafe-perm --omit=dev

npm ci is the equivalent of yarn --frozen-lockfile I believe?

popd
}

Expand Down
2 changes: 1 addition & 1 deletion ci/build/npm-postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ install_with_yarn_or_npm() {
echo "yarn.lock file present, running in development mode. use yarn to install code-server!"
exit 1
else
npm install --omit=dev
npm install --unsafe-perm --legacy-peer-deps --omit=dev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
npm install --unsafe-perm --legacy-peer-deps --omit=dev
# HACK: NPM's use of semver doesn't like resolving some peerDependencies that vscode (upstream) brings in the form of pre-releases.
# The legacy behavior doesn't complain about pre-releases being used, falling back to that for now.
# See https://github.com/coder/code-server/pull/5071
npm install --unsafe-perm --legacy-peer-deps --omit=dev

fi
;;
*)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "code-server",
"license": "MIT",
"version": "4.6.1",
"version": "4.6.1-1",
"description": "Run VS Code on a remote server.",
"homepage": "https://github.com/coder/code-server",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/node/test-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "test-plugin",
"version": "1.0.0",
"engines": {
"code-server": "^4.0.1"
"code-server": "^4.6.1-1"
},
"main": "out/index.js",
"devDependencies": {
Expand Down