- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是一名网络开发学生,我的一个 friend 也是。目前,我们正在使用同一课上同一本教科书提供的相同文件。练习的重点是练习 require.js 并探索它可以做什么。我们都采取了相同的步骤来确保下载了正确的包并且 Node 和 npm 版本是最新的。
当node index.js
在我的机器上运行,服务器开始监听 ::8080
并打印 os.tmpDir() is deprecated. Use os.tmpdir() instead.
由于我还是新手,我不能 100% 确定弃用实际上是什么,但我知道该应用程序仍然有效。
当node index.js
在她的机器上运行时,她收到一条错误消息,指出 os.tmpDir()
不是函数。我可以去哪里localhost:8080
, 她不能。
我们已经尝试卸载和重新安装 Node (稳定版本和最新版本),比较文件(相同),以及比较包版本。不知何故,尽管我们正在使用的东西(除了我们的机器)之间没有区别,但我们正在经历两种不同的结果。
有什么建议么?
错误信息:
C:\Users\Nereida\Documents\Classes\Summer2020\WEB.215\requirejs\node_modules\mach\lib\utils\makeTemporaryPath.js:4
var TMP_DIR = require("os").tmpDir();
^
TypeError: require(...).tmpDir is not a function
at Object.<anonymous> (C:\Users\Nereida\Documents\Classes\Summer2020\WEB.215\requirejs\node_modules[4mmach[24m\lib\utils\makeTemporaryPath.js:4:29)
at Module._compile (internal/modules/cjs/loader.js:1200:30)[39m
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)[39m
at Module.load (internal/modules/cjs/loader.js:1049:32)[39m
at Function.Module._load (internal/modules/cjs/loader.js:937:14)[39m
at Module.require (internal/modules/cjs/loader.js:1089:19)[39m
at require (internal/modules/cjs/helpers.js:73:18)[39m
at Object.<anonymous> (C:\Users\Nereida\Documents\Classes\Summer2020\WEB.215\requirejs\node_modules[4mmach[24m\lib\utils\saveToDisk.js:6:25)
at Module._compile (internal/modules/cjs/loader.js:1200:30)[39m
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
最佳答案
答案是 a comment from djfdev :
There's your problem, she needs to use
os.tmpdir()
with a lowercase d. As you pointed out, there was a deprecation warning about using the version with the uppercase D. It looks like this was removed entirely in node 14.
关于javascript - 为什么调用 os.tmpDir() 只会在某些机器上产生错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62163677/
我正在探索 Node 中的默认操作系统 npm,它们是 2 个具有相同名称的属性,一个是小写字母 (tmpdir),另一个是驼峰式 (tmpDir)。当我执行控制台日志时,我看到了相同的结果。 那么,
我在高性能计算系统上运行批处理作业来对对齐的读取进行排序,并使用 GNU parallel 来加速我的工作,但我的作业失败了,原因如下: parallel: Error: Output is inco
有没有办法使用 pytest fixture tmrdir 编写类的测试方法?在文档中,它指定它可以与函数一起使用。 https://docs.pytest.org/en/latest/tmpdir.
我正在尝试编译 ffmpeg 并且 tmp 目录有问题,因为它是用 noexec 挂载的: ./configure --enable-libmp3lame --enable-libvorbis --d
我是一名网络开发学生,我的一个 friend 也是。目前,我们正在使用同一课上同一本教科书提供的相同文件。练习的重点是练习 require.js 并探索它可以做什么。我们都采取了相同的步骤来确保下载了
我正在使用共享 Linux 集群,并且希望我的临时目录为 /tmp/username 而不是默认的 /tmp。 根据tempfile docs 、gettempdir() 应使用$TMPDIR 环境变
我正在运行大型查询,但收到以下错误: _mysql_exceptions.InternalError: (3, "Error writing file '/tmp/MYo8b3Z4' (Errcode
我正在使用 Cygwin 附带的 MySql Server。不管我是否这样开始: mysqld --tmpdir=/cygdrive/c/temp start 或者像这样: mysqld start
当我尝试获取 String tempdir = System.getProperty("java.io.tmpdir"); 时它将返回我的操作系统“temp”目录路径。例如普通 java 应用程序中的
我正在尝试使用此命令更改 java.io.tmpdir 目录 java -Djava.io.tmpdir=/temporary 但这不会成功并显示 java 命令的“用法”。我在 RHEL 机器上这样
我有一个 github 操作尝试使用 ${{ env.TMPDIR }} 并且它似乎没有扩展到 TMPDIR 环境变量。 - name: DEBUG Workaround GitHub-Action
目标是将附件下载到 tempdir 以供后续使用。 The documentation说使用ActiveStorage::Blob#open这似乎很简单。 我遇到了错误,所以请解释我做错了什么: 调用
我正在尝试制作一个 servlet 将文件上传到临时位置。当我构建文件路径时,一切似乎都正常。 String uploadFilePath = System.getProperty("java.io.
我正在尝试使用下面的命令让 mysqld 在不同的位置使用 my.cnf。 ./bin/mysqld --defaults-file=/apps/local/mysql/my.cnf 它不工作,服务器
我正在使用 std::tmpfile() 创建临时文件,但我想使用/tmp 以外的位置。我正在导出 $TMPDIR 以指向新位置,但 std::tmpfile() 没有选择新位置。 如何在/tmp 以
在 python 测试函数中 def test_something(tmpdir): with tmpdir.as_cwd() as p: print('here', p)
我使用 py.test 进行测试。 在 setup_class() 中,我需要为我的类构造函数使用 tmpdir: class TestMyClass: def setup_class(sel
我编译了下一段代码: #include #include int main(int argc, char* argv[]) { int rank, size, len; char
我最近看到一个示例,其中调用命令时将以下选项传递给 env: TMPDIR="${TMPDIR:-/tmp}" $TMPDIR 中的- 有什么作用?这是针对未指定的 linux 版本。 最佳答案 来自
我使用 TMP 环境变量来控制诸如 gcc 将其写入临时文件的位置,但我似乎找不到 java 的 createTempFile 的等效项API。 这样的环境变量存在吗? 最佳答案 根据java.io.
我是一名优秀的程序员,十分优秀!