npm

npm install in GitHub Action fails with “ENOENT: no such file or directory” - Works fine elsewhere

我是研究僧i 提交于 2021-02-08 13:29:14
问题 I am currently working on replacing our Drone CI installation with GitHub Actions. The Action Workflow I have so far boils down to the following .github/workflows/ci.yml file: on: [ push, pull_request ] name: CI jobs: test: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Install Node uses: actions/setup-node@v1 with: node-version: '13.x' - name: Install Dependencies run: npm install The log itself comes out as a long series of npm WARN tar ENOENT: no such file

npm link only dist folder

我与影子孤独终老i 提交于 2021-02-08 13:24:27
问题 Is there a way to restrict npm link to create the symlink only to point at ./dist ? I am struggling so far as I want to test my library (react component) locally before publishing. In my package.json I have included the main (entry point): "main": "./dist/index.js" But still when I run npm link it links to the parent folder which has node_modules and so on. This is causing problems cause now I have 2 react apps installed. I thought of a way to exclude node_modules but I couldn't even find a

npm link only dist folder

安稳与你 提交于 2021-02-08 13:21:58
问题 Is there a way to restrict npm link to create the symlink only to point at ./dist ? I am struggling so far as I want to test my library (react component) locally before publishing. In my package.json I have included the main (entry point): "main": "./dist/index.js" But still when I run npm link it links to the parent folder which has node_modules and so on. This is causing problems cause now I have 2 react apps installed. I thought of a way to exclude node_modules but I couldn't even find a

npm-force-resolutions not working when installing a new package

两盒软妹~` 提交于 2021-02-08 13:15:28
问题 I'm using the scripts section of the package.json to force resolutions: "preinstall": "npx npm-force-resolutions" in the resolutions section, I have entered graceful-fs with a specified version: "resolutions": { "graceful-fs": "^4.2.4", }, When i run npm i everything is installed correctly, the set versions are taken in to account. But later on when I install an additional module, e.g. npm i random-package , my set versions are being thrown away and I endup with graceful-fs@1.2.3 and other

error TS5014: Failed to parse file '': Unexpected token u in JSON at position 0. The terminal process terminated with exit code: 1

百般思念 提交于 2021-02-08 12:33:49
问题 I am receiving this error. error TS5014: Failed to parse file '/Users/Documents/tsconfig.json/tsconfig.json': Unexpected token u in JSON at position 0. The terminal process terminated with exit code: 1 My system setup: Visual Studio Code Version 1.14.1 Angular 2 node Version v8.0.0 tsc Version 2.4.1 package.json is as follows { "name": "angular-quickstart", "version": "1.0.0", "description": "QuickStart package.json from the documentation, supplemented with testing support", "scripts": {

How I can skip installing optional dependencies by 'npm ci'?

試著忘記壹切 提交于 2021-02-08 12:19:36
问题 How I can skip installing optional dependencies from package-lock.json by npm ci ? 回答1: You can use npm ci --no-optional . If npm still installs the optional package. Then try after removing package.lock.json and run the command again. 回答2: A bit late, but you can use npm ci --no-optional . I tested it. Make shure your npm version is a least 6.13.4 (maybe earlier version will work but I can't confirm). 来源: https://stackoverflow.com/questions/53969343/how-i-can-skip-installing-optional

How I can skip installing optional dependencies by 'npm ci'?

瘦欲@ 提交于 2021-02-08 12:18:53
问题 How I can skip installing optional dependencies from package-lock.json by npm ci ? 回答1: You can use npm ci --no-optional . If npm still installs the optional package. Then try after removing package.lock.json and run the command again. 回答2: A bit late, but you can use npm ci --no-optional . I tested it. Make shure your npm version is a least 6.13.4 (maybe earlier version will work but I can't confirm). 来源: https://stackoverflow.com/questions/53969343/how-i-can-skip-installing-optional

Minify multiple javascript files with webpack

喜夏-厌秋 提交于 2021-02-08 11:21:32
问题 I am new to webpack. I wish to minify all files in a folder to single js using webpack. I don't wish to add all files name manually one by one in entry section. I am quite sure there must be a clean way for that but I am unable to find that on google or webpack official documentation. Please help. 回答1: This might work: const glob = require("glob"); module.exports = { entry: glob.sync("./src/*.js") }; 来源: https://stackoverflow.com/questions/42710170/minify-multiple-javascript-files-with

How to download file over FTP in NodeJS?

只谈情不闲聊 提交于 2021-02-08 10:22:18
问题 I want to download file using absolute FTP URL, like ftp://host:port/dir/file.extension I've tried node-libcurl, wget, wget-improved, request . All failed saying that the protocol must be either HTTP or HTTPS. There are FTP clients available for Node (available on npmjs). But, as per their documentation, they require creating a connection to FTP Server, change directory and then download it. Is there any simple solution? 回答1: I will outline a simple approach here (and no complete solution

Three.js 场景、相机、渲染(01)

元气小坏坏 提交于 2021-02-08 09:47:58
前言:本篇主要是three.js的一个介绍,了解WebGL与three.js的关系。以及three.js的四个重要的组建。 文章目录 一、什么是WebGL? 1.1浏览器为什么能绘制3D? 1.2webgl能做什么 1.3 WebGL与three.js的关系 1.4 导入three.js (1)直接npm (2)单页面中引入 二、四大组建 2.1 场景 2.2 相机 2.2.1 透视相机 2.2.2 正投影相机 2.3 渲染器 2.3.1 渲染 2.3.2 实时渲染和离线渲染 2.4 几何体 三、一个栗子 一、什么是WebGL? WebGL 是一项可以在浏览器中流畅展示3D模型和场景的一种技术。他使用JavaScript作为编程语言,调用浏览器支持的3D绘制函数,来实现3D模型和场景的展现。 1.1浏览器为什么能绘制3D? 因为浏览器实现了OpenGL es的规范,这套规范可以直接使用指令操作显卡,使显卡渲染的3D世界,直接反应到浏览器中。 1.2webgl能做什么 游戏 家居 虚拟现实 城市地图 CAD制图 1.3 WebGL与three.js的关系 three.js是一个封装好的WebGL库,他使WebGL的学习更为简单。 1.4 导入three.js (1)直接npm 如果使用了框架,可以npm后再导入 npm install three --save 在使用的文件中引入