如果我具有应用程序的源代码以及macOS和Windows安装程序,那么如何找到用于构建该应用程序的Node.js版本? [英] if I have source code and macOS and Windows installers for an app, how can I find what version of Node.js was used to build the app?

查看:76
本文介绍了如果我具有应用程序的源代码以及macOS和Windows安装程序,那么如何找到用于构建该应用程序的Node.js版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要构建javascript Node.js应用程序的新版本.我具有该应用程序先前版本的源代码以及macOS和Windows安装程序.

I need to build a new version of a javascript Node.js app. I have the source code and the macOS and Windows installers for the previous version of the app.

如何查找使用哪个版本的Node.js来构建该应用程序的先前版本,所以我可以使用相同的Node.js版本来构建该应用程序的新版本?

How can I find what version of Node.js was used to build the previous version of the app, so I can use the same Node.js version to build my new version of the app?

我了解在构建macOS版本和Windows版本时,Node.js版本可能有所不同.理想情况下,我想知道每个平台都使用了哪个版本的Node.js,但是,如果我能获得至少一个满足我需要的版本,就可以了.

I understand that version of Node.js could have been different when building the macOS version and the Windows version. Ideally, I'd like to know what version of Node.js was used for each platform, but if I can get at least one that would be sufficient for my needs.

更新: package.json:

UPDATE: package.json:

{
  "name": "LiteracyStarter",
  "description": "Literacy Starter",
  "version": "0.60.1",
  "activated": true,
  "private": true,
  "main": "./build/LiteracyStarter.html",
  "nodejs": true,
  "chromium-args": "--disable-web-security",
  "window": {
    "toolbar": true,
    "width": 1260,
    "height": 750,
    "icon": "./images/LiteracyStarterIcon.png",
    "show": false
  },
  "dependencies": {
    "archiver": "^2.1.1",
    "arraybuffer-to-buffer": "0.0.4",
    "babel-plugin-transform-object-rest-spread": "^6.23.0",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-polyfill": "^6.23.0",
    "cf-encrypt": "^1.0.0",
    "cli-spinner": "^0.2.6",
    "co": "^4.6.0",
    "co-fs": "^1.2.0",
    "co-fs-extra": "^1.2.1",
    "d3-dsv": "^1.0.7",
    "decompress-zip": "^0.3.0",
    "dexie": "^1.5.1",
    "esrever": "^0.2.0",
    "form-data": "^2.2.0",
    "fs-extra": "^0.23.1",
    "fs-extra-promise": "^1.0.1",
    "fstream": "^1.0.11",
    "image-size": "^0.3.5",
    "is-online": "^5.2.0",
    "jssha": "^2.3.1",
    "jszip": "^2.6.1",
    "lodash": "^3.10.1",
    "markdown-it": "^8.3.1",
    "memoizejs": "^0.1.1",
    "moment": "^2.18.1",
    "parse-error": "^0.2.0",
    "portscanner": "^1.2.0",
    "promise-alert": "^0.1.1",
    "promisify-node": "^0.4.0",
    "pseries": "^1.0.3",
    "quill": "^0.20.1",
    "react": "^15.6.1",
    "react-addons-perf": "^15.4.2",
    "react-dom": "^15.6.1",
    "read-json-stream": "^1.1.0",
    "redux": "^3.7.2",
    "request": "^2.81.0",
    "rimraf": "^2.6.1",
    "rmrf-promise": "^1.1.0",
    "simple-sort": "^0.1.2",
    "socket.io": "^1.7.4",
    "socket.io-client": "^1.7.4",
    "socket.io-stream": "^0.9.1",
    "superagent": "^1.8.5",
    "sweetalert": "^1.1.3",
    "system-font-families": "^1.0.0",
    "ttfinfo": "^0.2.0",
    "unzip": "^0.1.11",
    "uuid": "^3.1.0",
    "webpack": "^3.8.1",
    "workerjs": "^0.1.1",
  },
  "optionalDependencies": {
    "appdmg": "^0.4.5"
  },
  "devDependencies": {
    "babel-cli": "^6.6.5",
    "babel-core": "^6.7.0",
    "babel-loader": "^6.2.4",
    "babel-plugin-syntax-async-functions": "^6.13.0",
    "babel-plugin-transform-es2015-modules-commonjs": "^6.18.0",
    "babel-preset-es2015": "^6.6.0",
    "babel-preset-react": "^6.5.0",
    "babel-register": "^6.9.0",
    "colors": "^1.1.2",
    "eslint": "^2.13.1",
    "eslint-plugin-react": "^4.3.0",
    "express": "^4.13.1",
    "grunt": "^0.4.5",
    "grunt-babel": "^6.0.0",
    "grunt-cli": "^1.3.2",
    "grunt-contrib-copy": "^0.8.0",
    "grunt-contrib-cssmin": "^0.12.3",
    "grunt-contrib-requirejs": "^0.4.4",
    "grunt-contrib-uglify": "^0.8.0",
    "grunt-contrib-watch": "^0.6.1",
    "grunt-nw-builder": "^3.1.0",
    "grunt-sloc": "^0.6.0",
    "grunt-webpack": "^3.0.2",
    "mocha": "^2.2.4",
    "nw-builder": "^3.1.0",
    "react-tools": "^0.13.3",
    "requirejs": "^2.1.17",
    "s3": "^4.4.0",
    "should": "^8.4.0",
    "single-line-log": "^1.1.2",
    "underscore.string": "^3.0.3"
  },
  "scripts": {
    "start": "cd build && nw .",
    "dev-start": "cd build && NODE_ENV=development nw . --load-extension=../../react-devtools",
    "build": "npm install && bower install && grunt build && cd build && npm install --production",
    "build-native": "node build-native.js",
    "localization-helper": "cd localizationHelper && http-server",
    "code-generator": "node ./code-generator/code-generator.js",
    "generate-docs": "jsdoc app-node -r -d docs-node && jsdoc app-client/js -r -d docs-client",
    "watch-node": "babel app-node --watch --out-dir build/app-node",
    "watch-client": "webpack --watch --progress",
    "watch-all": "grunt watch",
    "compile-setup-scripts": "node compile-setup-scripts.js",
    "comment": "For node 10.x, we have to add git-core to the PATH when we run win-complete-build.  See https://github.com/appveyor/ci/issues/2420 for an example.",
    "win-complete-build": "PATH=%PATH%;C:\\Program Files\\Git\\mingw64\\libexec\\git-core && npm run build && npm run build-native && npm run compile-setup-scripts",
    "test-sy-utils": "mocha --compilers js:babel-register ./test/sy-utils-tests.js",
    "test-flashcards": "mocha --compilers js:babel-register ./test/flashcard-generator-tests.js",
    "build-native-linux": "cd build-native/LiteracyStarter/linux64/ && node-deb -- **"
  },
  "cutoffDate": "",
  "preLiteracyVersion": "0.20.2",
  "id": "47479c35-18d9-4265-ad85-af5a73080450"
}

推荐答案

Node.js不与应用程序的源代码捆绑在一起. package.json可能有一个名为"engines"的部分,其中将说明您应使用的版本.

Node.js doesn't get bundled with the source code of apps. The package.json might have a section called "engines" in which it will state what version you should be using.

如果根目录package.json没有"engines"部分,则可能有一些依赖项确实说明了它们需要使用哪个版本.仔细检查每个人会很烦人,所以一个好方法就是下载一个版本的Node并运行npm install.如果一切正常,那么您就知道创建该应用程序的Node版本可能更旧(我知道它有点乏味).

If the root package.json doesn't have the "engines" section, then it may be posable that the some of the dependencies do say which version they require to be used. It would be kind of annoying going through each one to check, so a good way would be just to download a version of Node and run npm install. If everything works, then you know that the Node version the app was created in is most likely older (its a bit tedious, I know).

您可能会寻找的另一件事(但可能无济于事)是检查何时创建了源代码的文件(尤其是package.json文件),并找到了在该时间发布的Node版本. .这不会像第一种方法那样准确,但是它将为您提供Node的工作版本.

Another thing you could look for (but might not be to helpful) would be to check when the files of the source code were created (especially the package.json file), and find the Node version that was released around that time. This wont be as accurate as the first method but it will give you a working version of Node.

但是,归根结底,使用最新的版本(或最新的LTS版本)可能总是最好的选择,因为它们带有所有最新的安全补丁和改进.

When it comes down to it though, its probably always best to use the most up to date version (or the most recent LTS version) as they come with all the latest security patches and improvements.

这篇关于如果我具有应用程序的源代码以及macOS和Windows安装程序,那么如何找到用于构建该应用程序的Node.js版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆