问题标签 [npm-package]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
119 浏览

yarnpkg - 从 CodeArtifact 安装私有 npm 包失败,带有 yarn 和 yarn.lock 的“401 Unauthorized”

我们在 CodeArtifact 中有一个私有 npm 包,我们希望将其安装为package.json.

我们使用 Yarn 作为包管理器,并有一个yarn.lock文件来控制版本。尝试使用yarn install --frozen-lockfile它安装时,使用Request failed \"401 Unauthorized\.

使用 npm 时,它工作正常。但我们想坚持使用纱线。有人遇到过同样的问题吗?

0 投票
0 回答
97 浏览

angular - Observable between library - Angular 11+

I have three library that communicate each others some data. In particular I have a MAP that show some positions with markers, a TABLE that show details of each markers and the third library (we call it SHARED) have some service and observables that let to map and table to communicate each other. For example

  1. MAP (click a marker and recall a service of SHARED)
  2. SHARED make a next on observable send id of marker
  3. TABLE is listening, receives id and underline the row of the corresponding marker

I'll show some code of this communication:

  1. MAP recall SHARED when marker is clicked
  1. SHARED do next
  1. TABLE receives

I have no problems when I use Angular 10.0.4 and I compile my library normally:

When I pass to another project with Angular 11.2.10 I have to build my TABLE library with this option in tsconfig.lib.json

otherwise I get this error when I start the application

At the same time I have to compile MAP library with the same option but setted to true otherwise I get this error when I build the library

Compiling library in this way, I'm able to run the application but this particular observable not work!
NOTE that there are other observables from MAP to TABLE and also from TABLE to MAP always passing from SHARED (same structures showed before) and all they work correctly!!
I test also to subscribe directly my application to these observable but not even the application receives the id of marker.

Someone know why this specific observable not work only when I pass to Angular 11?

PS. since my first project was in Angular 10 my libraries are written in Angular 10, then I pass to a project with Angular 11 and I would to use the same libraries (that work perfectly even for this observable)

0 投票
0 回答
15 浏览

mysql - 谁能告诉我如何在节点中使用 sinch-rtc

谁能告诉我如何在节点中使用 sinch-rtc 我在尝试要求库进入节点服务器时遇到错误已附加错误屏幕截图

谢谢

0 投票
0 回答
19 浏览

npm - Vuex ORM:任何作为 vuex orm 商店的经验或示例 npm 包?

我打算制作一个代表 Vuex ORM 商店的 npm 包。

想法是让 vuex ORM 连接到特定的 API 并使用它的 Model 并提供同步数据的方法。

这样,任何使用此 npm 包的 UI 都可以轻松连接和使用特定 api 的数据模型。

问题是:有没有做类似事情的 npm 包?

是否有任何原因使这个想法不可能或难以实现?

0 投票
0 回答
23 浏览

npm - npm 安装时 Npm 包失败。我如何找出它的依赖树中包含的包?

有问题的包node-sass在我的create-react-app应用程序中。它的 C++ 构建失败,给了我这个错误。我react-scripts从我的 中删除了package.json,但我的一些包仍然react-scripts用作它的依赖项(如下面的输出所示)。我如何找到为什么node-sass在我的应用程序中?

在尝试安装之前,我删除了我的package.json和。node_modules这是我的日志输出。不幸的是,由于字符数限制,我不能直接包含它们......

npm 安装控制台输出:https ://pastebin.com/rV1UCqnA

/home/m/.npm/_logs/2021-08-16T20_00_36_625Z-debug.log上次日志中提到的结尾: https ://pastebin.com/QmdyKPXF

0 投票
3 回答
12431 浏览

node.js - ReferenceError:TextEncoder 没有用猫鼬定义 Node.js

问题似乎出在 mongoose 和 mongodb 包上,因为它在

已删除它在 repl.it 云环境上也可以正常工作这是我的代码

0 投票
1 回答
203 浏览

javascript - 如何将 js + assets 文件发布到 npm

我开发了一个小型 Ui 组件供公司内部使用,并将其发布到 npm,但是当我安装该软件包时,我只能index.js在文件夹中获得一个文件node_modules

我没有使用任何包生成器,es-modules,只是一个简单的.js.css

我要作为包发布的文件夹具有以下结构:

0 投票
0 回答
49 浏览

npm - 如何使用 lerna 将 README.md 推送到 npm

我创建了一个 npm 包并用这个脚本推送它:

但是,它不会推送 README.md,所以 npm 包页面是空白的,我在谷歌上找不到任何解决方案。这是文件夹结构:

在此处输入图像描述

我还将相同的 README.md 添加到“packages/”目录,但它也不起作用。

0 投票
0 回答
32 浏览

npm - NestJs 使用外部封装方法的问题

我在我的 NestJs 项目中安装了一个 MIME 库https://www.npmjs.com/package/mime (这是我的 package.json “mime”:“^2.5.2”中的一行)。

我以这种方式在我的代码中导入了这个包:

并使用这样的一些方法:

在控制台中,它会打印出这个错误:

但奇怪的是代码运行和工作,事实上,在我的数据库中,我存储了正确的 mime 类型:

在此处输入图像描述

我可以保留这些错误,但我想了解这种用法​​有什么问题,因为我显然遵循了所有库的指示。

我已经尝试删除 dist 和 node_modules 文件夹,npm i,清理缓存并重新运行。

非常感谢。

0 投票
2 回答
200 浏览

javascript - ./node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.mjs 尝试导入错误:“Picker”未从“selderee”导出

当我要导入 htmlToText 包时,出现此错误

然后我得到了这个错误