标签: node-modules

使用 npm runserve 命令时出现错误:getaddrinfo ENOTFOUND x86_64-apple-darwin13.4.0

我正在尝试使用 node.js 和 vue.js 创建一个网站。因此,要运行代码,我首先在终端中将目录更改为项目目录并使用npm run serve命令。但我仍然收到错误。我什至使用命令重新下载了npm库npm install。
错误是,

vue-cli-service serve INFO Starting development server... 10% building 5/5 modules 0 activeevents.js:174
throw er; // Unhandled 'error' event
^

Error: getaddrinfo ENOTFOUND x86_64-apple-darwin13.4.0 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26) Emitted 'error' event at: at GetAddrInfoReqWrap.doListen [as callback] (net.js:1448:12) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:17)

任何帮助将不胜感激。

node.js npm node-modules

4
推荐指数
1
解决办法
3061
查看次数

找不到模块“@auth0/angular-jwt/”

我目前正在开发一个使用 ADFS 身份验证的 Web 应用程序。

我有以下运行时错误:

“找不到模块@auth0/angular-jwt”。

我正在使用Angular 5.2.10。我尝试重新安装我的依赖项,但仍然有错误:

我有以下错误index.d.ts:

找不到名称“Provider”和“ModuleWithProviders”

并在jwt.interceptor.d.ts:

找不到模块“@angular/common/http”和“rxjs/internal/Observable”

并在jwtoptions.token.d.ts:

找不到模块“@angular/core”

我没有修改任何这些文件。

这是角度版本问题吗?我使用了这些库的错误版本吗?

感谢您的帮助!

node-modules typescript auth0 angular

4
推荐指数
1
解决办法
1万
查看次数

出现错误:解析方法过度指定。指定回调*或*返回 Promise;不是都

当我运行我的函数时,它给了我错误:Resolution method is overspecified. Specify a callback *or* return a Promise; not both.任何人都可以检查我的代码,并帮助解决这个问题吗?我在这里放置了完整的代码

it('Get Organizations', async function (done) {
        let user_permission = await commonService.getuserPermission(logged_in_user_id,'organizations','findAll');
        let api_status = 404;
        if(user_permission) { 
            api_status = 200;
        }

        let current_token = currentResponse['token'];
        old_unique_token = current_token;

        chai.request(app)
            .post('entities')
            .set('Content-Type', 'application/json')
            .set('vrc-access-token', current_token)
            .send({ "key": "organizations", "operation": "findAll" })
            .end(function (err, res) {
                currentResponse = res.body;
                expect(err).to.be.null;
                expect(res).to.have.status(api_status);
                done();
            }); 

    });
Run Code Online (Sandbox Code Playgroud)

mocha.js node.js node-modules chai

4
推荐指数
1
解决办法
2418
查看次数

收到错误:chromedriver 安装失败错误 eacces 权限被拒绝 mkdir

当我尝试使用npm install chromedriver --chromedriver-force-downloadNode js 安装 Chrome 驱动程序时,出现以下错误:chromedriver installation failed error eacces permission denied mkdir。

我已经申请了完全许可777,但仍然收到此错误,有人可以帮助我为什么会收到此错误吗?

我使用了这些命令:

1) npm i chromedriver

2) Force Download : npm install chromedriver --chromedriver-force-download
Run Code Online (Sandbox Code Playgroud)

mocha.js node.js selenium-chromedriver node-modules selenium-webdriver

4
推荐指数
1
解决办法
4816
查看次数

如何自引用NodeJS模块?

我有一个正在导出的模块。我需要一个函数来调用另一个函数。这是我正在尝试做的事情的简化版本。

module.exports = {
  isEven: (number) => {
    return (number%2 == 0)
  },
  isTenEven: () => {
    return isEven(10)
  }
}
Run Code Online (Sandbox Code Playgroud)

上面的代码在被调用isEven is not defined时会抛出异常moduleName.isTenEven()。

失败的原因是有道理的。但你会如何重写它呢?(同时保持单例模式)

javascript node.js node-modules

4
推荐指数
1
解决办法
1910
查看次数

GraphQL:用于构建架构的提供类型之一缺少名称

我正在学习 GraphQL 所以遇到了一个奇怪的问题

我在一个文件 Schema.js 上有以下代码:

const graphQL = require('graphql');
const lodash = require('lodash')
const { GraphQLObjectType, GraphQLString, GraphQLInt, GraphQLID, GraphQLSchema, GraphQLList } = graphQL;

const StatusType = new GraphQLObjectType({
name: 'Status',
fields: () => ({
    id: { type: GraphQLInt },
    statusName: { type: GraphQLString },
    user: {
        type: new GraphQLList(UserType),
        resolve(parentValue, args){
            
        }
    }
})
});

const UserType = new GraphQLObjectType({
name: 'User',
fields: () => ({
    id: { type: GraphQLString },
    username: { type: GraphQLString },
    mail: { …
Run Code Online (Sandbox Code Playgroud)

javascript node.js node-modules graphql

4
推荐指数
1
解决办法
3860
查看次数

zip 警告:压缩目录时缺少结束签名

我正在运行zip -r nm.zip node_modules并收到此错误:

zip warning: missing end signature--probably not a zip file (did you
zip warning: remember to use binary mode when you transferred it?)
zip warning: (if you are trying to read a damaged archive try -F)
Run Code Online (Sandbox Code Playgroud)

node_modules 是一个目录。我正在大厅内的 docker 容器内执行此操作。

zip node.js node-modules docker concourse

4
推荐指数
1
解决办法
8829
查看次数

无法找到名称空间“NodeJS”以及类型节点

我在我的网络应用程序中收到此错误

ERROR in node_modules/zone.js/dist/zone.js.d.ts:600:21 - error TS2503: Cannot find namespace 'NodeJS'.

600 declare var global: NodeJS.Global;
Run Code Online (Sandbox Code Playgroud)

正如您在下面看到的,我已经添加了该types": ["node"]属性,但它仍然无法正常工作

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "types": ["node"],
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "es6",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  }
}
Run Code Online (Sandbox Code Playgroud)

我实在不知道怎么解决。应用程序第一次启动获取Cannot GET /,然后在保存任何文件后,它可以工作,但仍然出现 NodeJS 错误。谢谢

node.js node-modules typescript angular

4
推荐指数
1
解决办法
5631
查看次数

如何从命令行使用节点模块?

我找不到任何关于此的简单说明。我已经安装了 node.js 和 npm,然后在其自己的文件夹 中创建了一个项目,D:\node_stuff然后通过cmd(Windows 10) cd 到那里并运行npm install express, npm init。我正在尝试使用gififynpm ,并通过而不是brew(ffmpeg、imagemagick、giflossy)安装其依赖项。

  • gifify -h->“gifify”不被识别为内部或外部命令、可操作程序或批处理文件。
  • node gifify -h-> 错误:找不到模块 'D:\node_stuff\gifify'
  • cd node_modules-> node gifify -h-> 什么也没发生

我究竟做错了什么?我什至在哪里看 - 所有带有简单搜索的教程仅显示如何安装软件包或构建项目 - 我不需要构建任何东西,只需使用这个模块。

node.js npm node-modules

4
推荐指数
1
解决办法
7518
查看次数

如果删除node_modules文件夹会发生什么?

通过安装任何软件包后我收到错误npm。每次我通过 提交申请时ng serve,都会出现错误,提示Error: Type [packageName] does not have '\xc9\xb5mod' property.我应该做什么?

\n

我想如果我删除我的node_modules文件夹并通过命令重新创建它npm install,它就会得到解决。

\n

任何人都可以建议,如果我删除node_modules文件夹并重新创建文件夹后,我会以删除之前的方式恢复所有已安装的软件包吗?

\n

npm node-modules angular

4
推荐指数
1
解决办法
2万
查看次数