我是Electron和Node.js的新手,现在我可以从视频教程中学习Electron。在本教程中,该人员使用npm install axios --save
安装axios,然后使用const axios = require('axios')
导入axios。问题是我的工作落后于代理,因此使用NPM安装软件包存在很大问题。但是我的另一个项目中已经有 axios 。因此,我只是将其复制并粘贴到当前教程项目的node_modules中。但是似乎const axios = require('axios')
在其中不起作用。如何在我当前的项目中使用复制的axios?
答案 0 :(得分:0)
Axios有很多devDependencies。只需复制它就不会安装这些文件。我建议复制您现有的项目(假设它在那里工作)。
"devDependencies": {
"bundlesize": "^0.17.0",
"coveralls": "^3.0.0",
"es6-promise": "^4.2.4",
"grunt": "^1.0.2",
"grunt-banner": "^0.6.0",
"grunt-cli": "^1.2.0",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-eslint": "^20.1.0",
"grunt-karma": "^2.0.0",
"grunt-mocha-test": "^0.13.3",
"grunt-ts": "^6.0.0-beta.19",
"grunt-webpack": "^1.0.18",
"istanbul-instrumenter-loader": "^1.0.0",
"jasmine-core": "^2.4.1",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.1.0",
"karma-jasmine": "^1.1.1",
"karma-jasmine-ajax": "^0.1.13",
"karma-opera-launcher": "^1.0.0",
"karma-safari-launcher": "^1.0.0",
"karma-sauce-launcher": "^1.2.0",
"karma-sinon": "^1.0.5",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.7.0",
"load-grunt-tasks": "^3.5.2",
"minimist": "^1.2.0",
"mocha": "^5.2.0",
"sinon": "^4.5.0",
"typescript": "^2.8.1",
"url-search-params": "^0.10.0",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1"
},