Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

engineStrict ignored #3672

Closed
borekb opened this issue Jul 19, 2013 · 11 comments
Closed

engineStrict ignored #3672

borekb opened this issue Jul 19, 2013 · 11 comments

Comments

@borekb
Copy link

borekb commented Jul 19, 2013

We run on Azure which is very picky about Node versions so I put this into my package.json file:

"engines": {
  "node": "0.8.22"
},
"engineStrict": true

However, I can still run the site fine on other 0.8 versions and npm install also doesn't complain about anything. I expected that I would get error either by running node server or npm install.

@luk-
Copy link
Contributor

luk- commented Jul 24, 2013

what module is this on? can you provide some more context?

@borekb
Copy link
Author

borekb commented Jul 30, 2013

The module is our express app, the provided snippet is in our main package.json file and as noted, I don't get any error anywhere.

@create-renegr
Copy link

I am having the some problem with npm 1.2.18:

  "engines": {
    "node": ">= 0.11.5"
  },
  "engineStrict": true

Running npm install or grunt results in no warning at all. Trying it with node v0.8.23 at that time.

@domenic
Copy link
Contributor

domenic commented Oct 8, 2013

I believe engineStrict was added in npm 1.3ish, so it won't work on Node 0.8/npm 1.2.

@domenic domenic closed this as completed Oct 8, 2013
@mgol
Copy link

mgol commented Oct 23, 2013

I've set engines.node to >=0.10.22 just to test it and yet no warning, even though I'm on new packages:

$ node --version
v0.10.21
$ npm --version
1.3.11

Perhaps this bug should be reopened?

@luk-
Copy link
Contributor

luk- commented Oct 23, 2013

I can't duplicate the issue, can you post a full package.json?

@mgol
Copy link

mgol commented Oct 23, 2013

@luk

{
    "name": "polona-gui",
    "version": "2.1.0-pre",
    "description": "Polona - National Library of Poland",
    "homepage": "http://polona.pl",
    "author": {
        "name": "Laboratorium EE",
        "url": "http://laboratorium.ee"
    },
    "repository": {
        "type": "git",
        "url": "ssh://[email protected]:7999/polona/polona-gui.git"
    },
    "bugs": "http://jira.defilada.laboratorium.ee/browse/POLGUI?selectedTab=com.atlassian.jira.plugin.system.project%3Aissues-panel",
    "devDependencies": {
        "connect-modrewrite": "~0.5.10",
        "grunt": "~0.4.1",
        "grunt-angular-templates": "~0.4.2",
        "grunt-contrib-clean": "~0.5.0",
        "grunt-contrib-concat": "~0.3.0",
        "grunt-contrib-connect": "~0.5.0",
        "grunt-contrib-copy": "~0.4.1",
        "grunt-contrib-htmlmin": "~0.1.3",
        "grunt-contrib-imagemin": "~0.3.0",
        "grunt-contrib-jshint": "~0.6.4",
        "grunt-contrib-sass": "~0.5.0",
        "grunt-contrib-uglify": "~0.2.4",
        "grunt-contrib-watch": "~0.5.3",
        "grunt-csso": "~0.5.0",
        "grunt-ddescribe-iit": "https://github.com/EE/grunt-ddescribe-iit/tarball/better-parsing",
        "grunt-defs": "~0.4.0",
        "grunt-inline-images": "~0.0.1",
        "grunt-jsonlint": "~1.0.1",
        "grunt-karma": "~0.6.2",
        "grunt-merge-conflict": "~0.0.2",
        "grunt-ng-annotate": "~0.0.2",
        "grunt-notify": "~0.2.13",
        "grunt-rev": "~0.1.0",
        "grunt-usemin": "~0.1.13",
        "karma-junit-reporter": "~0.1.0",
        "karma-ng-json2js-preprocessor": "~0.0.4",
        "load-grunt-tasks": "~0.1.3"
    },
    "engines": {
        "node": ">=0.10.22"
    },
    "engineStrict": true
}

@luk-
Copy link
Contributor

luk- commented Oct 23, 2013

luke test_strict_install $ npm i ../test_strict
npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your version of node/npm: [email protected]
npm ERR! notsup Required: {"node":">=0.10.22"}
npm ERR! notsup Actual:   {"npm":"1.3.11","node":"v0.10.21"}

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "i" "../test_strict"
npm ERR! cwd /private/tmp/test_strict_install
npm ERR! node -v v0.10.21
npm ERR! npm -v 1.3.11
npm ERR! code ENOTSUP
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /private/tmp/test_strict_install/npm-debug.log
npm ERR! not ok code 0

@mgol
Copy link

mgol commented Oct 23, 2013

@luk- I don't understand your comment. I just did npm install in a directory with exactly the package.json I posted and it went through without any warnings.

I'm on OS X 10.9.0.

@luk-
Copy link
Contributor

luk- commented Oct 23, 2013

@mzgol I put the package.json you provided in a directory and tried to install that directory. It worked correctly — not letting the install happen because the required version of node was not met.

engineStrict works on a per-module basis; it has to be set in the package.json of a module you are installing. You can also set engine-strict to true in your npm config to check if the version of node you are running meets what the engines field in a dependency's package.json is asking for.

engineStrict doesn't prevent you from installing dependencies if it's set in the package.json of the CWD.

@borekb
Copy link
Author

borekb commented Oct 24, 2013

If engineStrict works only from certain version of npm, it would be nice to have this noted in the documentation at https://npmjs.org/doc/json.html.

seleborg added a commit to seleborg/vacationexpenses that referenced this issue Feb 13, 2015
On Azure, only Node.js versions up to 0.10.32 are installed at the
moment (current release is 0.12.x). Note that this is for documentation
only, as npm doesn't seem to enforce this (even with engineStrict: true),
see npm/npm#3672.
seleborg added a commit to seleborg/vacationexpenses that referenced this issue Feb 13, 2015
On Azure, only Node.js versions up to 0.10.32 are installed at the
moment (current release is 0.12.x). Note that this is for documentation
only, as npm doesn't seem to enforce this (even with engineStrict: true),
see npm/npm#3672.
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

5 participants