npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Installing earlier using npm is ignored

I’m trying to install an earlier version of a repository using npm.

It’s regarding https://github.com/ProtonMail/pmcrypto/blob/v3.3.4/package.json

These are my dependencies:

{
  "dependencies": {
    "aglio": "^2.3.0",
    "atob": "^2.1.1",
    "btoa": "^1.1.2",
    "daemonize-process": "^1.0.9",
    "es6-promise": "^4.0.3",
    "express": "^4.16.3",
    "log4js": "^0.6.38",
    "multer": "^1.2.0",
    "pmcrypto": "github:ProtonMail/pmcrypto.git#v3.3.4",
    "request": "^2.87.0"
  }
}

If I run npm i pmcrypto 3.3.5 is installed:

[klukas@protonmail api-live]$ sudo /usr/local/bin/npm install -g npm
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
+ npm@6.4.1
added 256 packages from 147 contributors, removed 551 packages and updated 23 packages in 9.136s
[klukas@protonmail api-live]$ /usr/local/bin/npm version
{ npm: '6.4.1',
  ares: '1.13.0',
  cldr: '32.0.1',
  http_parser: '2.7.0',
  icu: '60.2',
  modules: '59',
  napi: '2',
  nghttp2: '1.29.0',
  node: '9.8.0',
  openssl: '1.0.2n',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.19.2',
  v8: '6.2.414.46-node.21',
  zlib: '1.2.11' }
[klukas@protonmail api-live]$ sudo su deploy
[deploy@protonmail api_test]$ rm package-lock.json && rm -rf node_modules/
[deploy@protonmail api_test]$ /usr/local/bin/npm i
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated jade@1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated constantinople@3.0.2: Please update to at least constantinople 3.1.1
npm WARN deprecated transformers@2.1.0: Deprecated, use jstransformer
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated text-encoding@0.6.4: no longer maintained

> protagonist@1.6.8 install /var/www/api_test/node_modules/protagonist
> node-gyp rebuild

make: Entering directory `/var/www/api_test/node_modules/protagonist/build'
  CXX(target) Release/obj.target/libmarkdownparser/drafter/ext/snowcrash/ext/markdown-parser/src/ByteBuffer.o
cc1plus: error: unrecognized command line option "-std=c++11"
cc1plus: error: unrecognized command line option "-std=c++11"
make: *** [Release/obj.target/libmarkdownparser/drafter/ext/snowcrash/ext/markdown-parser/src/ByteBuffer.o] Error 1
make: Leaving directory `/var/www/api_test/node_modules/protagonist/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:180:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Linux 2.6.32-754.3.5.el6.x86_64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/www/api_test/node_modules/protagonist
gyp ERR! node -v v9.8.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 

> aglio-theme-olio@1.6.3 postinstall /var/www/api_test/node_modules/aglio-theme-olio
> node scripts/setup-cache.js

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN api_test No repository field.
npm WARN api_test No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: protagonist@1.6.8 (node_modules/protagonist):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: protagonist@1.6.8 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

added 531 packages from 534 contributors and audited 1833 packages in 18.302s
found 17 vulnerabilities (10 low, 4 moderate, 3 high)
  run `npm audit fix` to fix them, or `npm audit` for details
[deploy@protonmail api_test]$ cat node_modules/pmcrypto/package.json 
{
  "_from": "github:ProtonMail/pmcrypto#v3.3.4",
  "_id": "pmcrypto@3.3.5",
  "_inBundle": false,
  "_integrity": "",
  "_location": "/pmcrypto",
  "_phantomChildren": {},
  "_requested": {
    "type": "git",
    "raw": "pmcrypto@github:ProtonMail/pmcrypto#v3.3.4",
    "name": "pmcrypto",
    "escapedName": "pmcrypto",
    "rawSpec": "github:ProtonMail/pmcrypto#v3.3.4",
    "saveSpec": "github:ProtonMail/pmcrypto#v3.3.4",
    "fetchSpec": null,
    "gitCommittish": "v3.3.4"
  },
  "_requiredBy": [
    "/"
  ],
  "_resolved": "github:ProtonMail/pmcrypto#000cd1e6079e2e375b41fb8ee1ec462caeb63ca0",
  "_spec": "pmcrypto@github:ProtonMail/pmcrypto#v3.3.4",
  "_where": "/var/www/api_test",
  "author": {
    "name": "ProtonMail"
  },
  "browser": "dist/pmcrypto-browser.js",
  "bugs": {
    "url": "https://github.com/ProtonMail/pmcrypto/issues"
  },
  "bundleDependencies": false,
  "dependencies": {
    "atob": "*",
    "btoa": "*",
    "emailjs-mime-parser": "^2.0.5",
    "openpgp": "3.1.3"
  },
  "deprecated": false,
  "description": "[![CircleCI](https://circleci.com/gh/ProtonMail/pmcrypto.svg?style=svg)](https://circleci.com/gh/ProtonMail/pmcrypto)",
  "devDependencies": {
    "babel-core": "^6.26.3",
    "babel-plugin-external-helpers": "^6.22.0",
    "babel-plugin-istanbul": "^4.1.4",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-plugin-transform-regenerator": "^6.24.1",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-polyfill": "^6.0.16",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-stage-0": "^6.24.1",
    "eslint": "^4.18.1",
    "eslint-config-airbnb-base": "^12.1.0",
    "eslint-plugin-import": "^2.9.0",
    "husky": "^1.1.0",
    "lint-staged": "^7.3.0",
    "mocha": "^5.2.0",
    "prettier": "^1.14.3",
    "rollup": "^0.63.4",
    "rollup-plugin-babel": "^3.0.7",
    "rollup-plugin-strip-code": "^0.2.6"
  },
  "homepage": "https://github.com/ProtonMail/pmcrypto#readme",
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "license": "MIT",
  "lint-staged": {
    "*.js": [
      "prettier --write",
      "git add"
    ]
  },
  "main": "dist/pmcrypto-node.js",
  "module": "lib/pmcrypto.js",
  "name": "pmcrypto",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/ProtonMail/pmcrypto.git"
  },
  "scripts": {
    "build": "rollup -c",
    "lint": "eslint $(find lib -type f -name '*.js')  --quiet",
    "pretty": "prettier --write $(find lib -type f -name '*.js')",
    "test": "mocha --ui tdd"
  },
  "version": "3.3.5"
}
[deploy@protonmail api_test]$ cat package.json 
{
  "dependencies": {
    "aglio": "^2.3.0",
    "atob": "^2.1.1",
    "btoa": "^1.1.2",
    "daemonize-process": "^1.0.9",
    "es6-promise": "^4.0.3",
    "express": "^4.16.3",
    "log4js": "^0.6.38",
    "multer": "^1.2.0",
    "pmcrypto": "github:ProtonMail/pmcrypto.git#v3.3.4",
    "request": "^2.87.0"
  }
}


Moved to #support because this is a run-script failure, not an npm failure.