package.json

How do I install a package with npm with a different/custom module name

坚强是说给别人听的谎言 提交于 2019-12-12 07:45:29
问题 I want to install a specific revision from a github tarball named something like "mymodule" and name it something like "mymoduleTemp", and then load a potentially different version of it that will take the real name "mymodule". So, how do I do the first thing? I'm looking for something like: npm install https://github.com/me/mymodule/tarball/someTag -name mymoduleTemp Is there any way to do that? A nice-to-have: If mymodule already exists, it doesn't get clobbered when mymoduleTemp is

read package.json from the code : package.json.js 404 (Not Found)

纵然是瞬间 提交于 2019-12-12 05:58:35
问题 I have an angular application but when I try this code : require("../../../package.json").version I get this error message : Error loading http://localhost/package.json.js as "../../../package.json" from app.component.js why am i getting : package.json.js file? with such bizzare extension? Thanks, 来源: https://stackoverflow.com/questions/44084857/read-package-json-from-the-code-package-json-js-404-not-found

Error: “extract-text-webpack-plugin” loader is used without the corresponding plugin,

馋奶兔 提交于 2019-12-12 05:39:51
问题 ERROR in ./client/styles/main.scss Module build failed: Error: "extract-text-webpack-plugin" loader is used without the corresponding plugin, refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example at Object.pitch (/Users/leongaban/projects/go/src/github.com/pizzahutdigital/mythor/node_modules/extract-text-webpack-plugin/dist/loader.js:53:11) @ ./client/index.js 25:0-29 @ multi ./client Not sure why this error is happening. However the main.scss file is getting

Module not found error when trying to use a module as a local module

给你一囗甜甜゛ 提交于 2019-12-12 03:39:58
问题 I am trying to understand as how to make a local module. At the root of node application, I have a directory named lib . Inside the lib directory I have a .js file which looks like: var Test = function() { return { say : function() { console.log('Good morning!'); } } }(); module.exports = Test; I have modified my package.json with an entry of the path to the local module: "dependencies": { "chat-service": "^0.13.1", "greet-module": "file:lib/Test" } Now, if I try to run a test script like:

NPM install does not install any dependencies from package.json

本小妞迷上赌 提交于 2019-12-12 03:35:17
问题 I am trying to run npm install from the root of my Node.js project, because I want to install all of my project dependencies located in my package.json . However, when I run npm install in the command line, it shows a list of the dependencies that it reportedly installed, however when I go to that directory and search for the subdirectory node_modules/ , it does not exist. Therefore, those dependencies were not really installed, as is evidenced when I try to run npm start , it will start

How to load script file dynamically in app.component.ts(angular)?

雨燕双飞 提交于 2019-12-11 17:43:02
问题 I am working in angular2 vs typescript. In my app.component.ts file i have to load the script files on demand based current navigator language. So i have added my function like below(home.component.ts), export class HomeComponent { constructor() { this.loadDynmicallyScript(); } public loadDynmicallyScript() { let node = document.createElement('script'); node.src = "../node_modules/xxxxxxxxxx/xx." + navigator.language"+".min.js"; node.type = 'text/javascript'; document.getElementsByTagName(

Error “Cannot read property 'bindings' of null” when trying to compile React project

ⅰ亾dé卋堺 提交于 2019-12-11 17:42:39
问题 After updating various packages with npm install --save <package-from-package.json>@latest , our UI-project in React can no longer be started (in developer mode in Visual Studio Professional 2017). The frontend error message is: bootstrap:83 Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js): TypeError: Cannot read property 'bindings' of null at Scope.moveBindingTo (C:\myProject\node_modules\@babel\traverse\lib\scope\index.js:860:13) at BlockScoping

How to fix Error `$map` of `map-get($map, $key)` must be a map in angular / stackblitz

夙愿已清 提交于 2019-12-11 10:53:33
问题 Attempting to create a custom theme with a theme.scss in Stackblitz created the error "Error in @angular/material/_theming.scss (1262:14) argument $map of map-get($map, $key) must be a map". I commented out every section that I thought might be responsible, which did not help. It looks like the error is actually in the angular material, but changing the material-version in package.json did not help either. I found a similar bug Error when creating Angular 2 custom theme, but the question was

Cannot start Electron application - missing package.json

蓝咒 提交于 2019-12-11 10:47:49
问题 I'm currently doing a Python project where I want to display my results in an Electron application. I have seen a demo video on YouTube on how to set up Electron on a Mac. The video showed 3 simple steps to be executed in the terminal: git clone https://github.com/electron/electron-quick-start cd electron-quick-start npm install && npm start When I first ran the above commands it worked fine for me. I was able to start the Electron application. But when I tried to re-start the application

Custom license url in package.json

为君一笑 提交于 2019-12-11 09:08:54
问题 I'm interested to know if there is a way for passing custom license urls in NPM's package.json files. I tried: { "license": {"name": "foo", "url": "http://example.com" } } It seems that this format is now deprecated: // Not valid metadata { "license" : { "type" : "ISC" , "url" : "http://opensource.org/licenses/ISC" } } Is there another way to pass the license url in package.json? 回答1: It seems there is another/new way to do it. Recently my npm packages started to complain when I was using {