"Foundation-ReferenceError:在启动基础zurb项目时未定义原始函数." [英] "Foundation - ReferenceError: primordials is not defined when starting a foundation zurb project."

查看:115
本文介绍了"Foundation-ReferenceError:在启动基础zurb项目时未定义原始函数."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建Foundation Zurb项目时出错.尝试使用针对其他应用程序显示的先前建议来解决,但没有一个起作用.

Getting an error when creating a Foundation Zurb project. Tried to solve using the previous suggestions shown for other applications, but none are working.

一个帖子提到了更新榆木,我这样做了,但是,它没有用.此外,我查看了Gulp 3(我正在使用gulp 4)的已解决问题,但没有可行的修复程序(Gulp 3在Node 12#2324上损坏)或解决方法.

A post referenced updating elm, and I did so, however, it did not work. Additionally, I reviewed the closed issue for Gulp 3 (i am using gulp 4), but there was not viable fixes (Gulp 3 is broken on Node 12 #2324) or workarounds.

$ foundation new --framework emails
fs.js:27
const { Math, Object } = primordials;
                         ^

ReferenceError: primordials is not defined
    at fs.js:27:26
    at req_ (/usr/lib/node_modules/foundation-cli/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/usr/lib/node_modules/foundation-cli/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/usr/lib/node_modules/foundation-cli/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)

我希望该项目能够建立.

I expect the project to build.

推荐答案

我猜您使用的是NodeJS12.
当前的CLI不支持NodeJS 12.请使用NodeJS 10.

I guess you use NodeJS 12.
NodeJS 12 is not supported by the current CLI. Please use NodeJS 10.

您可以使用nvm,n,nodenv或用于管理NodeJS版本的任何其他解决方案切换到NodeJS 10.

You can switch to NodeJS 10 using nvm, n, nodenv or any other solution for managing NodeJS versions.

primordialsnatives程序包的一部分,并在graceful-fs程序包中调用,如您在堆栈跟踪中所见.

primordials is part of the natives package and called in the graceful-fs package as you can see in the stacktrace.

您可以尝试将graceful-fs依赖项从3升级到4,但是如果没有其他更改,这可能无法正常工作.

You can try to upgrade the graceful-fs dependency from 3 to 4 but this might not work without other changes.

这是在graceful-fs 3的fs.js中:

This is in fs.js of graceful-fs 3:

module.exports = require('natives').require('fs', ['stream'])

npmjs.com 上的natives页面上:

此软件包已被弃用 作者留言:

This package has been deprecated Author message:

此模块依赖于Node.js的内部结构,并且在某些时候会中断.不要使用它,并更新到graceful-fs@4.x.

This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.

另请参见 https://travis-ci.com/DanielRuf/foundation-cli-test/builds/112738932

将此与拥有NodeJS 10的环境进行比较(gulp团队已删除4.0标记,您可以将package.json中的行更改为引用gulp 4.0.0):

Compare this to the environment where we have NodeJS 10 (the team of gulp has deleted the 4.0 tag, you can change the line in package.json to reference gulp 4.0.0):

这篇关于"Foundation-ReferenceError:在启动基础zurb项目时未定义原始函数."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆